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得无语了,求人看看我的代码...thx~

Posted by gxiverson at 2007-02-01 21:31:08 on Problem 2092
#include<iostream>
using namespace std;
int main()
{
	int a[10001]={0},num,numa,i,j,up;
	int b[201][201]={0};
	int m,n;
	cin>>m>>n;
	while(!(m==0&&n==0))
	{
		
		up=0;
		num=0;
		memset(a,0,sizeof(a));
		for(i=1;i<=m;i++)
		{
		    for(j=1;j<=n;j++)
			{
			    cin>>b[i][j];
			    a[b[i][j]]++;
			}
		}
		for(i=1;i<=10000;i++)
		{
			if(num<a[i])
			{
				num=a[i];
				numa=i;
			}
		}
		num=0;
		for(i=1;i<=10000,i!=numa;i++)
		{
			if(num<a[i])
			{
				num=a[i];
			}
		}
		for(i=1;i<=10000;i++)
		{
			if(a[i]==num)
				cout<<i<<" ";
		}
		cout<<endl;
		cin>>m>>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