您的位置:首页 > 编程语言 > C语言/C++

POJ 1005.I Think I Need a Houseboat

2017-01-26 11:32 330 查看
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <stdlib.h>
#include <math.h>

using namespace std;

const double  PI = 3.1415926;
int main()
{
int n;
double x, y;
double distance,s;
//freopen("d:\\input.txt", "r", stdin);
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> x >> y;
distance = x*x + y*y;
s = PI*distance/2;
printf("Property %d: This property will begin eroding in year %d.\n", i, static_cast<int>(s / 50) + 1);
}
puts("END OF OUTPUT.");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息