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<iostream.h> void main (void) { int i=0,j=0,k=0,n,m; int max=0,s=0,min=0; int b[50]={0}; char ch[100]; cin>>m>>n; cin.getline(ch,100); char a[100][150]; for(i=0;i<n;i++) { cin.getline(a[i],150); } for(k=0;k<n;k++) { for(i=0;i<m;i++) { for(j=i;j<m;j++) { if(a[k][i]>a[k][j])b[k]++; } } if(b[k]>max)max=b[k]; } min=max+1; for(j=0;j<n;j++) { for(i=0;i<n;i++) { if(b[i]<min) { s=i; min=b[i]; } } cout<<a[s]<<endl; b[s]=max+1; min=max+1; s=0; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator