enamsustcse

10432 Polygon Inside A Circle

May 1st, 2012
82
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.  
  4. int main()
  5. {
  6.     double n, r, area;
  7.  
  8.     while (scanf("%lf %lf", &r, &n) == 2)
  9.     {
  10.         area = n * r * r * sin(2 * 3.141592653589793238462643383279 / n) / 2;
  11.         printf("%.3lf\n", area);
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment