Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:被WA得无语了,求人看看我的代码...thx~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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator