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

Re:求教!为什么总是Output Limit Exceeded(C代码)

Posted by sudden770 at 2011-07-27 15:20:08 on Problem 3781
In Reply To:求教!为什么总是Output Limit Exceeded(C代码) Posted by:caojingkun886 at 2011-07-25 16:59:51
这个是我帮你改的
#include<stdio.h>
void maopao(int a[])
{
	int i,j,temp;
	for(i=0;i<9;i++)
		for(j=i+1;j<10;j++)
			if(a[j]<a[i])
			{
				temp=a[i];
				a[i]=a[j];
				a[j]=temp;
			}
}
main()
{
	int n,a[10],i,sum=0,m,max=0;
	scanf("%d",&m);
	while(m--)
	{
    	scanf("%d",&n);
    	for(i=0;i<10;i++)
	  scanf("%d",&a[i]);	
	 maopao(a);
	printf("%d %d\n",n,a[7]);	
	}

}
你的程序太杂乱了

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