Pabon_SEC

Colourful flowers

Sep 3rd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. #define PI acos(-1)
  4. main()
  5. {
  6.     long long int a,b,c;
  7.     double R,r,s,d,e,f,g,h,i;
  8.     while(scanf("%lld%lld%lld",&a,&b,&c)!=EOF)
  9.     {
  10.         s=(a+b+c)/2.0;
  11.         r=sqrt(s*(s-a)*(s-b)*(s-c))/s;
  12.         e=PI*r*r;
  13.         f=sqrt(s*(s-a)*(s-b)*(s-c));
  14.         R=(a*b*c)/(4*f);
  15.         g=PI*R*R;
  16.         h=g-f;
  17.         i=f-e;
  18.         printf("%.4lf %.4lf %.4lf\n",h,i,e);
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment