ACPrimer

POJ 1005 I Think I Need a Houseboat

May 16th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #define PI 3.1415926
  4. int main()
  5. {
  6.     int T,ncase=0,ans;
  7.     double x,y,r;
  8.     scanf("%d",&T);
  9.     while(T--)
  10.     {
  11.         scanf("%lf%lf",&x,&y);
  12.         r=sqrt(x*x+y*y);
  13.         ans=(int)ceil(PI*r*r/2/50);
  14.         printf("Property %d: This property will begin eroding in year %d.\n",++ncase,ans);
  15.     }
  16.     printf("END OF OUTPUT.\n");
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment