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 |
求助~~~~~~为什么运行结果为-171798692???郁闷~#include<math.h> #include<stdio.h> void main(){ int n[22],i,j,k,sum=0,left,t; for(k=0;k<22;k++){ scanf("\n%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); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator