I Think I Need a Houseboat

http://poj.org/problem?id=1005

#include<stdio.h>
#include<string.h>
#include <math.h>
const double pi = acos(-1.0);
int main()
{
    int t,j;
    scanf("%d",&t);
    for (int i = 1;i <= t;i ++)
    {
        double x,y,r;
        int cnt = 1;
        scanf("%lf%lf",&x,&y);
        r = x*x+y*y;
        for (j = 50;;j = j+50)
        {
            if (j >= 1.0/2*(pi*r))
            break;
            cnt++;
        }
        printf("Property %d: This property will begin eroding in year %d.
",i, cnt);
    }
    puts("END OF OUTPUT.");
    return 0;
}
View Code
原文地址:https://www.cnblogs.com/lahblogs/p/3232112.html