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

Re:留个纪念(第一次哦)

Posted by sunchy at 2014-08-06 18:00:52 on Problem 2255
In Reply To:留个纪念(第一次哦) Posted by:lanjiangzhou at 2012-04-11 21:20:06
> #include<stdio.h>
> #include<string.h>
> void build(int n,char*s1,char*s2)
> {
> 	if(n<=0)return ;
> 	int p=strchr(s2,s1[0])-s2;
> 	build(p,s1+1,s2);
> 	build(n-p-1,s1+p+1,s2+p+1);
> 	printf("%c",s1[0]);
> }
> int main()
> {
> 	char s1[30],s2[30],ans[30];
> 	memset(s1,0,sizeof(s1));
> 	memset(s2,0,sizeof(s2));
> 	while(scanf("%s %s",s1,s2)!=EOF)
> 	{
> 		int n=strlen(s1);
> 		build(n,s1,s2);
> 		ans[n]='\0';
> 		printf("\n");
> 	}
> 	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