题意是说从0点开始发水,每年发水面积为50,以圆形向外扩散,给出一个点问水什么时候蔓延到这个点(输出整数),一道数学题而已,算出这个点到圆心的距离,然后算以这个距离为半径的圆的面积,因为上面是半圆,所以处理面积的时候要用100进行计算而不是50,。
下面AC代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const double PI=3.1415926;
int main()
{
int T;
int k=0;
double x,y;
double a;
int t;
scanf("%d",&T);
while(T--)
{
k++;
scanf("%lf%lf",&x,&y);
a=PI*(x*x+y*y);
t=a/100+1;
cout<<"Property "<<k<<": This property will begin eroding in year "<<t<<"."<<endl;
if(T==0)
cout<<"END OF OUTPUT."<<endl;
}
return 0;
}