2 1.0 1.0 25.0 0.0
Sample Output
Property 1: This property will begin eroding in year 1. Property 2: This property will begin eroding in year 20. END OF OUTPUT.
题意:每年腐蚀50,计算他所在的位置什么时候被腐蚀
注意格式,最后一次输出END OF OUTPUT.并且还要换行
#include<stdio.h>
#include<math.h>
#define p 3.1415926
int main()
{
int t,k=1;
scanf("%d",&t);
while(t--)
{
double x,y,are,r,year;
scanf("%lf%lf",&x,&y);
r=sqrt(x*x+y*y);
are=(p*r*r)/2;
year=are/50;
printf("Property %d: This property will begin eroding in year %d.\n",k++,(int)year+1);
}
printf("END OF OUTPUT.\n");
return 0;
}