POJ1005-I Think I Need a Houseboat

来源:互联网 发布:福建安全网络知识竞赛 编辑:程序博客网 时间:2024/06/09 18:54
#include<iostream>using namespace std;int main(){int N;double x, y;cin >> N;for (int i = 0; i < N; i++) {int year = 0;cin >> x >> y;double dis = x*x + y*y;double radius = 0;while (radius < dis) {year++;radius += 100.0 / 3.1415;}cout << "Property " << i + 1 << ": This property will begin eroding in year " << year << ".\n";}cout << "END OF OUTPUT.";return 0;}