2012年1月9日 星期一

acm 10499 The Land of Justice

[心得] 0.036
球體表面積公式為 4*π*R*R
1.如果切成 一半,可以想像多兩個大圓面積 為2*(R*R*π)
    ==>2*(R*R*π) /4*π*R*R =50%
 2.如果球體等分成3塊, 表面積會多 6*(1/2*R*R*π)  (想像每個切面都是1/2個大圓面積)
    ==>3*(R*R*π) /4*π*R*R =75%
 3.如果球體等分成3塊, 表面積會多 8*(1/2*R*R*π)
    ==>4*(R*R*π) /4*π*R*R =100%



#include <stdio.h>

int main()
{
   long long int number;
   while(scanf("%lld",&number)!=EOF)
   {
      if(number <0)
         break;                            
      if(number == 1) 
         printf("0%%\n");
      else
         printf("%lld%%\n",25*number);          
   }
  system("pause");
  return 0;
}

沒有留言:

張貼留言