Tuesday, June 7, 2016

uva 12578 solution

Unknown
#include<cstdio>
#include<cmath>
#define pi acos(-1)
using namespace std;
int main()
{
    int t,l;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%d",&l);
        double green,red,len,wid,r;
        len=(double)l;
        wid=len*0.60;
        r=len/5.0;
        red=pi*r*r;
        green=len*wid-red;
        printf("%.2lf %.2lf\n",red,green);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,