POJ 1005_I Think I Need a Houseboat

来源:互联网 发布:淘宝网电脑主板 编辑:程序博客网 时间:2024/06/05 04:24




#include <iostream>#include <cmath>using namespace std;const float PI = 3.14159;int main(){int N,NUM;float sum = 0, posX, posY, year, radius;cin >> N;NUM = 0;while (N--){NUM++;cin >> posX >> posY;radius = sqrt(posX*posX + posY*posY);for (year = 1; sqrt(100.0*year / PI)<radius; year++){}cout << "Property " << NUM << ": This property will begin eroding in year " << year << "." << endl;}cout << "END OF OUTPUT." << endl;return 0;}


0 0
原创粉丝点击