Advertisement
Saleh127

UVA 11152

Oct 23rd, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. #define pi acos(-1.0)
  6. int main()
  7. {
  8. ios_base::sync_with_stdio(0);
  9. cin.tie(0);
  10. cout.tie(0);
  11.  
  12. double a,b,c,sun,vio,rose,icr,ocr,tri,s;
  13.  
  14. while(scanf("%lf %lf %lf",&a,&b,&c)==3)
  15. {
  16. s=(a+b+c)/2.00;
  17. tri=sqrt(s*(s-a)*(s-b)*(s-c));
  18.  
  19. ocr=(a*b*c)/(4.00*tri);
  20. sun=pi*ocr*ocr;
  21.  
  22. icr=tri/s;
  23. rose=pi*icr*icr;
  24.  
  25. vio=tri-rose;
  26. sun=sun-tri;
  27.  
  28. printf("%.4lf %.4lf %.4lf\n",sun,vio, rose);
  29. }
  30.  
  31. return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement