UVA 11152 Colourful Flowers Solution

Solve in C++:

//AH Tonmoy
//Department of CSE ,Islamic University
#include <bits/stdc++.h>
using namespace std;
int main()
{
 int a,b,c;
 double rs,rr,ra,vio,ros,asun,va,as,s;
 while(cin>>a>>b>>c)
 {
    s=(a+b+c)/2.0;
    vio=sqrt(s*(s-a)*(s-b)*(s-c));
    rs=(a*b*c)/(4*vio);
    as=rs*rs*acos(-1);
    asun=as-vio;
    rr=vio/s;
    ra=rr*rr*acos(-1);
    va=vio-ra;
    printf("%.4lf %.4lf %.4lf\n",asun,va,ra);
 }
return 0;

}

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.