代码改变世界

POJ1005

2012-01-05 10:01  Jeff  阅读(564)  评论(0编辑  收藏  举报
#include "stdio.h"
#include "math.h"
int main(void) {
    int num;
    float x_value=0.0;
    float y_value=0.0;
    int a =1;
    int result;
    float length;
    #ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
    #else
    #endif

    scanf("%d",&num);
    //printf("%dn",num);
    while(num>0){
         scanf("%G%G",&x_value,&y_value);
         //printf("%G  %Gn",x_value,y_value);
         length = sqrt(x_value*x_value + y_value*y_value);
         result =(3.1415926*length*length/100)+1;
        // printf("%dn",result);
printf("Property %d: This property will begin eroding in year %d.n", a,result);
         num--;
         a++;
    }
     printf("END OF OUTPUT.");
    //printf(Property 1: This property will begin eroding in year 1.);
    #ifndef ONLINE_JUDGE
    fclose(stdin);
    #else
    #endif
    return 0;
}