ZOJ-1049

今天是ZOJ-1049-I Think I Need a Houseboat。
简单。

#include 
#include 
#define PI 3.1415926535
int main()
{
    int N,i,j=1;
    float x,y;
    scanf("%d",&N);
    while(N--)
    {
        int S=0,r=0;
        scanf("%f %f",&x,&y);
        for(i=0;x*x+y*y>r*r;i++)
        {
            r=sqrt(2*S/PI);
            S+=50;
        }
        printf("Property %d: This property will begin eroding in year %d.\n",j,i-1);
        j++;
    }
    printf("END OF OUTPUT.\n");
    return 0;
}

你可能感兴趣的:(ZOJ-1049)