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> using namespace std; char a[100][100]; char s[100][100]; int main() { int n,m; cin>>n>>m; int i,j,k,number,l; for(i = 0; i < m; ++i) for(j = 0; j < n; ++j) cin>>s[i][j]; number = 0; for( i = 0; i < m; ++i) { number = 0; for(j = 0; j < n; ++j) for(k = j + 1; k < n; ++k) if(s[i][j] > s[i][k]) number ++; j = 1; l = 0; /*if(a[number][0] >= 'A' && a[number][0] <= 'Z') { while(a[number][j * n] >= 'A' && a[number][j * n] <= 'Z') j++; l = j * n; }*/ for(k = 0; k < n; ++k) a[number][l++] = s[i][k]; } number = 0; for(i = 0; i < 100; ++i) { if(a[i][0] <'A' || a[i][0] > 'Z') continue; for(j = 0; j < n; ++j) cout<<a[i][j]; cout<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator