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 |
n可以等于10,所以就有a[10],而你开的是a[0]----a[9]In Reply To:请教 Posted by:scandrive at 2004-12-11 01:10:09 > #include<stdio.h> > void main() > { > int i,n,a[10],b[10],x,s; > scanf("%d",&n); > while(n>=1&&n<=10) > { > for(i=1;i<=n;i++) > scanf("%d %d",&a[i],&b[i]); > for(b[0]=0,i--,s=0;i>0;i--) > { > x=a[i]*(b[i]-b[i-1]); > s=s+x; > } > printf("%d miles\n",s); > scanf("%d",&n); > } > } > > > 显示:Runtime Error 不明白了………… > 可以 教教我吗? Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator