首页 > 代码库 > poj: 1005

poj: 1005

简单题

 1  #include <iostream> 2  #include <stdio.h> 3  #include <string.h> 4  #include <stack> 5  using namespace std; 6  7  #define PI 3.1415926 8  9  int N;10 11  int main()12  {13      cin >> N;14      double x, y;15      for (int t = 1; t <= N; ++t) {16         cin >> x >> y;17         int n = 1;18         while (1) {19             double r = n*100/PI;20             if (x*x + y*y < r) break;21             n++;22         }23         cout << "Property " << t << ": This property will begin eroding in year " << n << "." << endl;24      }25      cout << "END OF OUTPUT." << endl;26      return 0;27  }

 

poj: 1005