#include <sstream>
#include "iostream"
#include "stdlib.h"
#include "vector"
#include "cmath"
#include "algorithm"
#include "map"
#include "fstream"
#include "queue"
#include "unordered_map"
#include "unordered_set"
#include "stack"
#include<Windows.h>
using namespace std;
static bool bo;
class Node
{
public:
char data;
Node* lchild;
Node* rchild;
};
using Tree = Node*;
void CreateTree(Tree& t)
{
char c;
cin >> c;
if (c == '#')
{
t = nullptr;
}
else
{
t = new Node;
t->data = c;
CreateTree(t->lchild);
CreateTree(t->rchild);
}
bo = 1;
}
void DLR(const Tree& t)
{
if (bo != 1)
{
cout << "数为空" << endl;
return;
}
std::cout << t->data << " ";
if (t->lchild)
{
DLR(t->lchild);
}
if (t->rchild)
{
DLR(t->rchild);
}
}
void LDR(const Tree& t)
{
if (bo != 1)
{
cout << "数为空" << endl;
return;
}
if (t->lchild)
{
LDR(t->lchild);
}
std::cout << t->data << " ";
if (t->rchild)