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 zhou6978490 at 2009-08-05 19:01:59 on Problem 1617
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int i,j,m,n,l;
	
	char a[20],b[20],d[100],e[20];
	char c[10][10];
	while(cin>>a&&strcmp( a, "THEEND")!=0)
	{
		cin>>d;
		n=0;
        strcpy(b,a);
		strcpy(e,a);
		sort(b,b+strlen(a));
		
		for(i=0;i<strlen(a);i++)
			for(j=0;j<strlen(a);j++)
			{
				if(e[j]==b[i])
				{
					e[j]='0';
					for(m=0;m<(strlen(d)/strlen(a));m++,n++)
					{
						c[m][j]=d[n];
					}
					break;
				}
				
				
			}
			for(l=0;l<strlen(d)/strlen(a);l++)
				for(i=0;i<strlen(a);i++)
				{
					cout<<c[l][i];
				}
				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