poj1005

简单题

View Code
#include <iostream>
#include <cmath>
using namespace std;

const    double    pi = 3.14159265;

int work()
{
    double    x, y, l;

    cin >> x;
    cin >> y;
    l = x * x + y * y;
    return int(l * pi / 100) + 1;
}

int main()
{
    int        n, t;

    //freopen("t.txt", "r", stdin);
    t = 0;
    cin >> n;
    while (n--)
    {
        t++;
        printf("Property %d: This property will begin eroding in year %d.\n", t, work());
    }
    cout << "END OF OUTPUT." << endl;
    return 0;
}
原文地址:https://www.cnblogs.com/rainydays/p/2797132.html