POJ 1005 I Think I Need a Houseboat C++版

题目链接:http://poj.org/problem?id=1005

水题,文字还一大串,题意就是那个半圆每年增加50平米,问多少年到(x,y)这个点

代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*Problem: 1005		User: awq123
**Memory: 252K Time: 0MS
**Language: C++ Result: Accepted
*/
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
float x,y;
int t,n,i;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>x>>y;
t=3.1415926*(x*x+y*y)/2;
cout<<"Property "<<i<<": This property will begin eroding in year "<<t/50+1<<"."<<endl;
}
cout<<"END OF OUTPUT."<<endl;
}