UVA problem id :11152 - Colourful Flowers

// https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=0&problem=2093 #include <bits/stdc++.h> using namespace std; #define PI acos(-1) int main() { int a,b,c,i,j; double sunflowerArea,roseArea,violatesArea,s,roseRadius,sunflowerRadius; while(cin>>a>>b>>c){ s=0.5*(a+b+c); violatesArea=sqrt(s*(s-a)*(s-b)*(s-c)); roseRadius=(violatesArea/s); roseArea=PI*roseRadius*roseRadius; sunflowerRadius=(a*b*c)/(4*violatesArea); sunflowerArea=(PI*(sunflowerRadius)*(sunflowerRadius))-violatesArea; violatesArea=violatesArea-roseArea; printf("%.4lf %.4lf %.4lf",sunflowerArea,violatesArea,roseArea); cout<<endl; } return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.