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 |
Re:高人指点帮我看看哪错了啊,In Reply To:高人指点帮我看看哪错了啊, Posted by:safulas at 2009-02-16 15:28:26 > #include<stdio.h> > #define PI 3.1415926 > void main() > { > unsigned int N,i,j,a[10]; > double x[10],y[10],s=0; > scanf("%d",&N); > for(i=0;i<N;i++) > scanf("%lf%lf",&x[i],&y[i]); > for(j=0;j<N;j++) > { > for(a[j]=0;(x[j]*x[j]+y[j]*y[j])>s;a[j]++) > s=(a[j]+1)*100/PI; > } > for(j=1;j<=N;j++) > { > printf("Property %d: This property will begin eroding in year %d.\n",j,a[j-1]); > } > printf("END OF OUTPUT.\n"); > } s必须每次都赋成0 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator