ZOJ Problem Set - 1049

ZOJ Problem Set - 1049

I Think I Need a Houseboat

#include<stdio.h>
#define pi 3.1415926
int main(void)
{
    int n;
    double x, y;

    while (scanf_s("%d", &n) != EOF)
    {
        for (int i = 0; i < n; ++i)
        {
            scanf_s("%lf%lf", &x, &y);
            int result = (pi*(x*x + y*y) / 100) + 1;
            printf("Property %d: This property will begin eroding in year %d.\n", i + 1, result);
        }
        puts("END OF OUTPUT.");
    }
    return 0;
}

你可能感兴趣的:(文章标题)