Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int t,i,c;
- double R,n,x,r,pi;
- pi=2*acos(0.0);
- scanf("%d",&t);
- for(i=1;i<=t;i++){
- scanf("%lf %lf",&R,&n);
- x=sin(pi/n);
- r=(R*x)/(1+x);
- c=ceil(r);
- if(r==c)
- printf("Case %d: %d\n",i,c);
- else
- printf("Case %d: %lf\n",i,r);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement