Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么是cpp(18) : fatal error C1004: unexpected end of file found?

Posted by ye at 2004-12-15 00:29:15 on Problem 2000
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator