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

你程序都错了

Posted by wuyang1988 at 2007-08-24 14:09:39 on Problem 1011
In Reply To:我的程序居然还超时.... Posted by:zhzm883 at 2006-08-15 01:30:31
> #include"stdio.h"
> 
> main()
> {
> int n, i ,j, a[64],sum=0, max=0;
> scanf("%d",&n);
> while(n)
> {
> 	sum=0;
> 	max=0;
> 	for(i=0;i<n;i++)
> 	{
> 		scanf("%d",&a[i]);
> 		if(max<a[i])
> 			max=a[i];
> 		sum+=a[i];
> 	}
> 	for(j=max+1;;j++)
> 		if(sum%j==0)
> 			break;
> 		printf("%d\n",j);
> 		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