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 |
我在本机上测试都通过了,为什么一提交就是wrong answer呢?望好心人指教#include<iostream> using namespace std; int main() { int row,col; cin>>row>>col; char ptr[100][50]; for(int i = 0;i < row;i++) for(int j = 0;j < col;j++) cin>>ptr[i][j]; int min = 0; int counter[100] = {0},mark[100] = {0}; for(int m = 0;m < row;m++){ for(int l = 0;l < col - 1;l++){ for(int k = l + 1;k < col;k++){ if(ptr[m][l] > ptr[m][k]) counter[m]++; } } } for(int w = 0;w < row;w++){ for(int q = 0;q < row;q++) if(mark[q] == 0){ min = q; break; } for(int y = q;y < row;y++) if(counter[y] < counter[min] && mark[y] == 0) min = y; for(int x = 0;x < col;x++) cout<<ptr[min][x]; cout<<endl; mark[min] = 1; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator