http://poj.org/problem?id=1005
1 #include<stdio.h> 2 #define M_PI 3.14159265358979323846 3 /*使用math.h中M_PI的程序在OJ上无法编译通过 4 Compile Error 5 Main.c 6 F:\temp\15366798.60331\Main.c(10) : error C2065: 'M_PI' : undeclared identifier 7 */ 8 int main() 9 { 10 int n,i; 11 double x,y,S/*腐蚀到坐标(x,y)时河水腐蚀了的面积*/; 12 //freopen("test.in", "r", stdin); 13 while(scanf("%d",&n)!=EOF) 14 { 15 for(i=0; i<n; i++) 16 { 17 scanf("%lf%lf",&x,&y); 18 S=M_PI*(x*x+y*y)/2; 19 printf("Property %d: This property will begin eroding in year %d.\n",i+1,(int)(S/50)+1); 20 } 21 printf("END OF OUTPUT."); 22 } 23 return 0; 24 }