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;
}
posted @ 2012-12-01 11:20  金海峰  阅读(288)  评论(0编辑  收藏  举报