Saturday, July 16, 2016

UVA 10432 Solution

Unknown
#include<cstdio>
#include<cmath>
using namespace std;
#define pi 2*acos(0)

int main()
{
    double r,n,ans;
    while (scanf("%lf%lf",&r,&n)!=EOF)
    {
        ans=n*r*r*sin(2.0*pi/n)/2;
        printf("%.3lf\n",ans);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,