这道题的大致意思:
圆表示一块面积可扩展的区域,开始时,面积是0,在(0,0)处开始以每年50平方米的速度同样呈半圆扩展,输入一个正整数N,然后输入N对坐标,对于每一对坐标值:求出面积扩展到该点的年数,坐标值单位为米。
理解意思后此题就水很多了。细心的话一次搞定~
#include < iostream >
#include < cstdio >
#include < cmath >
using namespace std;
const double PI = 3.1415926 ;
int main()
{
int n;
cin >> n;
for ( int i = 1 ;i <= n;i ++ )
{
double x,y;
cin >> x >> y;
cout << " Property " << i << " : This property will begin eroding in year " << ceil(PI * (x * x + y * y) / 100.0 ) << " . " << endl;
}
cout << " END OF OUTPUT. " << endl;
return 0 ;
}