这是一道基本题,需要注意的是This property...这句话前面需要输出一个空格,否则会提示“Wrong Answer”
C++代码:
#include<stdio.h>
#include<math.h>
#define PI 3.1415927
int main()
{
int n,year;
double x,y,r,S;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%lf%lf",&x,&y);
r=x*x+y*y;
S=PI*r;
year=(int)ceil(S/100.0f);
printf("Property %d:",i);
printf(" This property will begin eroding in year %d.\n",year);
}
printf("END OF OUTPUT.\n");
return 0;
}