#include <iostream>
using namespace std;
string a,b;
void f(string cx,string zx){
if(zx.size()==0) return ;
char root=cx[0];
int rootid=zx.find(root);
string lzx=zx.substr(0,rootid);
string rzx=zx.substr(rootid+1);
string lcx="",rcx="";
for(int i=1;cx[i];i++){
int d=lzx.find(cx[i]);
if(d!=-1) lcx+=cx[i];
else rcx+=cx[i];
}
cout<<root;
f(lcx,lzx);
f(rcx,rzx);
}
int main(){
cin>>b>>a;
f(a,b);
return 0;
}
(责任编辑:admin) |