-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1219.cpp
More file actions
23 lines (19 loc) · 697 Bytes
/
1219.cpp
File metadata and controls
23 lines (19 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
double a, b, c;
while(cin >> a >> b >> c) {
double p = (a + b + c) / 2;
double triangle_area = sqrt((p*(p-a)*(p-b)*(p-c)));
double circle_r = (a * b * c) / (4 * triangle_area);
double circle_area = M_PI * (pow(circle_r, 2));
double second_circle_r = triangle_area / p;
double second_circle_area = M_PI * (pow(second_circle_r, 2));
cout << fixed << setprecision(4);
cout << circle_area - triangle_area << " " << triangle_area - second_circle_area << " " << second_circle_area << endl;
}
return 0;
}