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:求助~~~~~~为什么运行结果为-171798692???郁闷~In Reply To:求助~~~~~~为什么运行结果为-171798692???郁闷~ Posted by:90405125 at 2004-12-23 18:42:08 > #include<math.h> > #include<stdio.h> > void main(){ > int n[22],i,j,k,sum=0,left=0,t=0; > for(k=0;k<22;k++){ > scanf("%d",&n[k]); > if(n[k]==0)break; > for(i=1;left>=0;i++){ > left=n[k]-i; > t=i; > } > for(j=1;j<=t;j++) > sum=sum+j*j; > sum=sum+left*(t+1); > printf("%d %d\n",n[k],sum); > > } > } 我小改了一下,结果为494,还是不对哦,求助~~ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator