#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
string s1,s2;
void calc(int l1,int r1,int l2,int r2)
{
int m=s1.find(s2[r2]);
cout<<s2[r2];
if(m>l1)calc(l1,m-1,l2,l2+m-l1-1);
if(m<r1)calc(m+1,r1,l2+m-l1,r2-1);
}
int main()
{
cin>>s1>>s2;
calc(0,s1.length()-1,0,s2.length()-1);
return 0;
}
求前序遍历
最新推荐文章于 2022-05-12 10:59:40 发布