UVA Problem 10286 (Trouble with a Pentagon) Solution

Problem Solving, UVa

 

#include <bits/stdc++.h>

#include <math.h>

#define pi acos(0.0)

//#define pi 3.1416

int main()

{

double n;



while(scanf("%lf",&n) != EOF )

{

    //poligon_inte_angle = (3/5)*180=(108 degree)as figure sides n=5;

    //square_inte_angle  = (2/4)*90=(63 degree) as figure sides n=4;

printf("%.10lf\n",( n*sin(108*pi/90 ) / sin(63*pi/90) ));//* pi/90



}



return 0;

}

 

0 Comments

You may find interest following article