标签:
> 分析
1 #include "stdio.h" 2 3 #define PI 3.14f 4 5 int main(void) 6 { 7 int n = 0 ; 8 int i = 0 ; 9 float x = 0.0, y = 0.0; 10 int years = 0 ; 11 12 scanf("%d", &n) ; 13 14 for(i = 0; i < n; i++) 15 { 16 scanf("%f %f", &x, &y) ; 17 years = (int)(PI * (x * x + y * y) / 2 / 50) + 1; 18 19 printf("Property %d: This property will begin eroding in year %d.\r\n", 20 i + 1, years) ; 21 } 22 23 printf("END OF OUTPUT.\r\n") ; 24 return 0 ; 25 }
POJ-1005: I Think I Need a Houseboat 详解1: 直接计算
标签:
原文地址:http://www.cnblogs.com/codesworld/p/4714691.html