hdu1065

http://acm.hdu.edu.cn/showproblem.php?pid=1065

错了n次了,让所有的水题汗颜啊!

15103750_IyHQ.gif 15103750_yL8f.gif View Code

    
#include " iostream "
using namespace std;
#define pi 3.1415926 // 3.1415927(wrong)
int main()
{
int n;
double a,b,sum;
cin
>> n;
int i = 0 ;
while (n -- )
{
cin
>> a >> b;
sum
= pi * (a * a + b * b) / 2 ;
int x = ( int )(sum / 50 ) + 1 ; // (int)sum/50+1(wrong)
cout << " Property " <<++ i << " : " << " This property will begin eroding in year " ;
cout
<< x << " . " << endl;
}
cout
<< " END OF OUTPUT. " << endl;
return 0 ;
}

转载于:https://my.oschina.net/garyun/blog/602882

猜你喜欢

转载自blog.csdn.net/weixin_33830216/article/details/91774210
今日推荐