首页 > 代码库 > Poj 1005

Poj 1005

 刚开始的时候下意识想把坐标半径和每一年淹没的半径求出来做比较……

 1 #include<iostream>
 2 #define pi 3.14159265
 3 using namespace std;
 4 int main(){
 5     int N;
 6     double x,y;
 7     int year;
 8     cin>>N;
 9     for(int i=0;i<N;i++){
10         cin>>x>>y;
11         year=pi*(x*x+y*y)/100+1;
12         cout<<"Property "<<i+1<<": This property will begin eroding in year "<<year<<"."<<endl;
13     }
14     cout<<"END OF OUTPUT.";
15 } 

 

Poj 1005