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 |
Re:在本地测试是对的,提交上去就是RE。希望大家帮忙看看。In Reply To:在本地测试是对的,提交上去就是WA。希望大家帮忙看看。 Posted by:zhufeng597 at 2015-11-05 14:10:34 #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) for(j = 0; j < 100; ++j) { if(a[i][j] >='A' && a[i][j] <= 'Z') { cout<<a[i][j]; ++number; if(number == n) { cout<<endl; number = 0; } } else break; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator