其他分享
首页 > 其他分享> > T236450 美国血统

T236450 美国血统

作者:互联网

 

 

但是 代码没过 g      
#include <iostream>
#include<string.h>
using namespace std;
char M[100],F[100],L;
char Tree[100];

void ForTree(int root,int l,int r){
if(l>r)return;
int newRoot =l;
while(newRoot<=r && F[newRoot]!=M[root]){
    newRoot++;
}
ForTree(root+1,l,newRoot-1);
ForTree(root+1+newRoot-l,newRoot+1,r);
cout<<M[root];

}
int main()
{

    cin>>M;
    cin>>F;
    int len=strlen(M);
    Tree[0]=F[0];

    ForTree(0,0,len-1);
    /*int i,j=0;//i 是M的指针,j是F的指针
    for(int k=1;k<len;k++){
        while(){

        }
        Tree[k]=
    }*/







    return 0;
}

  


网址 :https://www.luogu.com.cn/problem/T236450?contestId=67903

 

 

 

标签:T236450,int,newRoot,char,美国,100,include,血统
来源: https://www.cnblogs.com/syxw/p/16197244.html