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 |
为什么是cpp(18) : fatal error C1004: unexpected end of file found?#include<stdio.h> #include<math.h> void main() { int n,i,m,c,sum; scanf("%d",&n); while(n!=0){ i=1; sum=0; if(n>(i+1)*i/2)c=i++; else{ for(i=0;i<c;i++)sum=sum+i*i; m=sum+(n-(c-1)*c/2)*c; printf("%d %d",n,m); scanf("%d",&n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator