poj1005 I Think I Need a Houseboat(水题)
解题思路:数学公式的运用。R*R=x*x+y*y。面积S=1/2*pi*R*R。以每年50侵蚀,所以k=S/50+1 (最后要取整)
注意:格式。
#include<stdio.h>
#include<stdlib.h>
int main(){
int i,t,k;
double x,y;
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%lf%lf",&x,&y);
k=(int)(3.14151926*(x*x+y*y)/100.0+1.0);
printf("Property %d: This property will begin eroding in year %d.\n",i,k);
}
printf("END OF OUTPUT.\n");
//system("pause");
return 0;
}