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

poj 1005 I Think I Need a Houseboat

时间:2016-07-30 22:30:47      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:

 1 #include <iostream>
 2 using namespace std;
 3 const double pi = 3.1415926535;
 4 
 5 int main()
 6 {
 7     int t,time = 0;;
 8     double x,y;
 9     cin >> t;
10     while(t--)
11     {
12         ++time;
13         cin >> x >> y;
14         double area = pi*(x*x + y*y);
15         int res = (int)(area/100.0) + 1;
16         cout<<"Property "<<time<<": This property will begin eroding in year "<<res<<.<<endl;
17     }
18     cout<<"END OF OUTPUT."<<endl;
19     return 0;
20 }

 

poj 1005 I Think I Need a Houseboat

标签:

原文地址:http://www.cnblogs.com/guoyongheng/p/5721826.html

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