码迷,mamicode.com
首页 > 其他好文 > 详细

poj: 1005

时间:2015-01-13 14:01:59      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

简单题

 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

标签:

原文地址:http://www.cnblogs.com/yingzhongwen/p/4221052.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!