Poj Solution 1005

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



#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define M_PI        3.14159265358979323846
#define DEBUG 0

int main(void) {
    if(DEBUG)
        freopen("in","r",stdin);
    int year,n,i=1;
    double x,y,radius,area;
    scanf("%d",&n);
    while(n--){
      scanf("%lf%lf",&x,&y);
      radius=x*x+y*y;
      area=M_PI*radius/2.0;
      year=(int)ceil(area/50);
      printf("Property %d: ",i++);
      printf("This property will begin eroding in year %d.n",year);
    }
    printf("END OF OUTPUT.n");
    return 0;
}

											
This entry was posted in poj. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *