原题地址:http://acm.jlu.edu.cn/joj/showproblem.php?pid=1085
很简单的数学问题。
#include <iostream>
using namespace std;
const double PI = 3.1415;
int main()
{
int i,n,years;
double a,b,rs;
cin>>n;
i = 1;
while(i<=n)
{
cin>>a>>b;
rs = (a*a + b*b) * PI / 2;
years = 1;
while(50 * years <rs)
years++;
cout<<"Property "<<i<<": This property will begin eroding in year "<<years<<"./n";
i++;
}
cout<<"END OF OUTPUT."<<endl;
system("PAUSE");
}