Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
C++编译就可以,C定义变量放在函数的开始。In Reply To:为什么是compile error,请帮忙看看啊,谢谢啊。 Posted by:wangdi_nenu_cs at 2010-05-09 20:30:10 > > #include<stdio.h> > #define PI 3.14159 > int main(){ > > int n; > int year[100]; > scanf("%d",&n); > > for(int i=0;i<n;i++) > { > > float x,y; > scanf("%f %f",&x,&y); > if(x<0) > x=-x; > float s=PI*(x*x+y*y); > year[i]=(int)s/100+1; > > > > } > for( i=0;i<n;i++) > printf("Property %d: This property will begin eroding in year %d.\n",i+1,year[i]); > printf("END OF OUTPUT.\n"); > > return 0; > > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator