zju1049

I Think I Need a Houseboat

http://acm.zju.edu.cn/show_problem.php?pid=1049

   1 /*written by czk*/
   2 #include <stdio.h>
   3 #include <math.h>
   4 int main() {
   5     int t, i;
   6     scanf("%d", &t);
   7     for(i = 1; i <= t; i++) {
   8         double x, y;
   9         scanf("%lf%lf", &x, &y);
  10         double square_radius = x*x + y*y;
  11         double area = 3.141592653589793 * square_radius * 0.5;
  12         printf("Property %d: This property will begin eroding in year %.0f.\n", i, floor(area / 50.0) + 1);
  13     }
  14     printf("END OF OUTPUT.\n");
  15 }

zju1049 (2008-06-02 13:15:15由czk编辑)