Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

在本地测试是对的,提交上去就是WA。希望大家帮忙看看。

Posted by zhufeng597 at 2015-11-05 14:10:34 on Problem 1007
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator