Pabon_SEC

Polygon inside a circle

Sep 3rd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. #define PI acos(-1)
  4. main()
  5. {
  6.     double r,n,a,b,c;
  7.     while(scanf("%lf%lf",&r,&n)!=EOF)
  8.     {
  9.         a=n*r*r;
  10.         b=2*PI;
  11.         b=sin(b/n);
  12.         c=(a*b)/2;
  13.         printf("%.3lf\n",c);
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment