poj 2959(水题,注意是直径和球球之间距离)
#include<iostream> #include<cmath> using namespace std; #define PI 3.14159265 int main(){ double D,d,s; int n,result; scanf("%d",&n); while(n--){ scanf("%lf%lf%lf",&D,&d,&s); result = floor(PI/(PI/2-acos((d+s)/(D-d)))); printf("%d\n",result); } return 0; }
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号