Tuesday, 10 February 2015

Solution Of Light Online Judge 1072

#include<stdio.h>
#include<math.h>
#define PI 3.14159265
int main()
{
    double R,r,g;
    int i,j,n;
    scanf("%d",&j);
    for(i=0;i<j;i++){
      scanf("%lf",&R);
  scanf("%d",&n);
      r=((sin(PI/n)*R)/(sin(PI/n)+1));
        printf("Case %d: %.10lf\n",i+1,r);
    }

}

No comments:

Post a Comment