您的位置:首页 > 其它

POJ 1005 & ZOJ 1049 & UVA 2363

2017-07-03 14:20 302 查看
思路:求出在x,y点的面积,除以每年的腐蚀面积,向上取整,使用ceil()函数
#include <iostream>

using namespace std;
#define PI 3.141592653

int main()
{
int test_num;
cin >> test_num;
double x,y;
double area;
int year;
for(int i = 1 ; i <
4000
= test_num; i++)
{
cin >> x;
cin >> y;
area = (x * x + y * y) * PI / 2;
year = int(area/50)+1;
cout << "Property " << i <<": This property will begin eroding in year " << year <<"." <<endl;
}

cout << "END OF OUTPUT" << endl;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: