Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define PI 3.141592653589793
- int main() {
- double a, b, c;
- double s, bigCirc, triang, smallCirc, rad;
- while(scanf("%lf %lf %lf", &a, &b, &c) != EOF){
- s = (a+b+c)/2.0;
- triang = sqrt( (s*(s-a)*(s-b)*(s-c)) );
- rad = (a*b*c)/(4*triang);
- bigCirc = (pow(rad, 2)*PI) - triang;
- smallCirc = pow( (triang/s),2)*PI;
- triang = triang-smallCirc;
- printf("%.4lf %.4lf %.4lf\n", bigCirc, triang, smallCirc);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment