C++代码
  1. /*  
  2. Title: I Think I Need a Houseboat  
  3. Problem URL: http://acm.zju.edu.cn/show_problem.php?pid=1049  
  4. Author: Moqi  
  5. Date: 2007-12-31  
  6. Description:   
  7. */  
  8. #include <stdio.h>   
  9. #include <math.h>   
  10. int main()   
  11. {   
  12.     int i, j, n;   
  13.     float d, a, b;   
  14.     scanf("%d", &n);   
  15.     for(i = 1; i <= n; i++)   
  16.     {   
  17.         scanf("%f %f", &a, &b);   
  18.         d = a * a + b * b;   
  19.         j = d * 3.14159 / 100;   
  20.         j = j + 1;   
  21.         printf("Property %d: This property will begin eroding in year %d.\n", i, j);   
  22.     }   
  23.     printf("END OF OUTPUT.\n");   
  24.     return 0;   
  25. }