Saturday, July 16, 2016

Published July 16, 2016 by with 0 comment

UVA 10432 Solution

#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;
}
      edit

0 comments:

Post a Comment