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

Posted by yangjunguang at 2009-07-21 11:20:12 on Problem 2092
In Reply To:被WA得无语了,求人看看我的代码...thx~ Posted by:gxiverson at 2007-02-01 21:31:08
> #include<iostream>
> using namespace std;
> int main()
> {
> 	int a[10001]={0},num,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];
> 				
> 			}
> 		}
                for(i=1;i<=10000;i++)
                {
                   if(a[i]==num)
                      a[i]=0;
                }
> 		num=0;
> 		for(i=1;i<=10000;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