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 |
被WA得无语了,求人看看我的代码...thx~#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator