#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define PI acos(-1.0)
int main()
{
double rad, n, area;
while(scanf("%lf %lf", &rad, &n)==2)
{
area = n*(rad*rad)*sin((2*PI)/n)*0.5;
printf("%0.3lf\n", area);
}
}
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define PI acos(-1.0)
int main()
{
double rad, n, area;
while(scanf("%lf %lf", &rad, &n)==2)
{
area = n*(rad*rad)*sin((2*PI)/n)*0.5;
printf("%0.3lf\n", area);
}
}
No comments:
Post a Comment