1.poj 1799 Yeehaa!
题意:告诉你大圆半径,和大圆内最多能放的小圆个数,求小圆半径。
画个图就知道答案了。
1 #include<iostream> 2 #include<stdio.h> 3 #include<cstring> 4 #include<cstdlib> 5 #include<math.h> 6 double PI = acos(-1.0); 7 using namespace std; 8 9 int main() 10 { 11 int T,n,t; 12 double R,r; 13 scanf("%d",&T); 14 for(t=1;t<=T;t++) 15 { 16 scanf("%lf%d",&R,&n); 17 r = R*sin(PI/n)/(1+sin(PI/n)); 18 printf("Scenario #%d:\n",t); 19 printf("%.3lf\n\n",r); 20 } 21 return 0; 22 }
原文:http://www.cnblogs.com/tom987690183/p/3677940.html