参考:
1 #include2 #include 3 #include 4 #include 5 #define pi 3.1415926 6 using namespace std; 7 int main() 8 { 9 int t;10 while (cin>>t)11 {12 for (int j=1;j<=t;j++)13 {14 float d,x,y;15 cin>>x>>y;16 d=sqrt(x*x+y*y);17 for (int i=1;;i++)18 {19 float s=i*100.0;20 float r=sqrt(s/pi);21 if (d<=r)22 {23 cout<<"Property "< <<": This property will begin eroding in year "< <<'.'<