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

哪位帮我看看,为什么wa了,数据都过了

Posted by xiaolijian at 2010-08-09 17:02:30 on Problem 2092
#include <stdio.h>
#include <string.h>
#define M 1001

int main()
{
	int i,j,n,m,max,second,a[M][M],t[M];
	while(scanf("%d%d",&n,&m)&&n)
	{
		max=0;
		memset(a,0,sizeof(a));
		memset(t,0,sizeof(t));
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				scanf("%d",&a[i][j]);
				++t[a[i][j]];
			}
		}
		second=0;
		for(i=0;i<=100;i++)
		{
			if(max<t[i])
			{
				second=max;
				max=t[i];
			}	
		}
		for(i=0;i<=100;i++)
			if(t[i]==second)
				printf("%d ",i);
		printf("\n");			
	}
	return 0;
}

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