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了,数据都过了#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator