中午也不想睡觉,再刷一道好了。
这题的题意真是隐晦,图的暗示更操蛋……被河水侵蚀的区域是半圆,面积每年增加50,给出坐标问哪年会被淹。
#include<stdio.h>
#include<math.h>
int main()
{
const double pai=3.1415926;
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
int a=1,s=50;
double x,y,r,l;
scanf("%lf %lf",&x,&y);
r=sqrt(x*x+y*y);
l=sqrt(2*s/pai);
while(r>l)
{
s+=50;
l=sqrt(2*s/pai);
a++;
}
printf("Property %d: This property will begin eroding in year %d.\n",i+1,a);
}
printf("END OF OUTPUT.");
return 0;
}