| ||||||||||
| 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 | |||||||||
麻烦帮我看看错在哪啊????#include<iostream>
using namespace std;
int main(){
int n,m,c;
cin>>n>>m;
char a[100][50];
int b[100];
for(int i=0;i<m;i++){
b[i]=0;
for(int j=0;j<n;j++){
cin>>a[j][i];
}
for(int k=0;k<n-1;k++){
for(int g=k+1;g<n;g++){
if(a[k][i]>a[g][i]) b[i]++;
}
}
}
cout<<endl;
for(int l=0;l<m-1;l++){
for(int o=m-1;o>l;o--){
if(b[l]>b[o]){
for(int q=0;q<n;q++){
c=a[q][l];a[q][l]=a[q][o];a[q][o]=c;
}
}
}
}
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
cout<<a[j][i];
}
cout<<endl;
}
system("pause");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator