#include <iostream>
#include <string>
#include <string.h>
using namespace std;
void slove(char*,char*,int);
int main(){
char pr[60], in[60];
string str1, str2;
while (cin >> str1 >> str2){
strcpy(pr,str1.c_str());
strcpy(in, str2.c_str());
slove(pr,in,str1.length());
cout << endl;
}
}
void slove(char *pr, char *in, int length){
if (length == 0) return;
char a = *pr;
int rootIndex = 0;
for (; rootIndex < length; rootIndex++){
if (in[rootIndex] == *pr) break;
}
slove(pr + 1, in, rootIndex);
slove(pr + rootIndex + 1, in + rootIndex + 1, length - rootIndex - 1);
cout <<a;
}
uva536
最新推荐文章于 2022-01-11 14:10:33 发布