#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef int TypeDATA;
typedef struct binary_tree {
TypeDATA data;
struct binary_tree *lchild, *rchild;
} BINARY_TREE;
BINARY_TREE *creat_node() {
char val;
BINARY_TREE *Next_point = NULL;
scanf("%c", &val);
if ('#' != val) {
Next_point = (BINARY_TREE *) malloc(sizeof(BINARY_TREE) + 1);
Next_point->data = val;
Next_point->lchild = creat_node();
Next_point->rchild = creat_node();
}
return Next_point;
}
int pre_vis(BINARY_TREE *InRoot) {
if (InRoot) {
printf("%c ", InRoot->data);
pre_vis(InRoot->lchild);
pre_vis(InRoot->rchild);
}
return 0;
}
int main() {
BINARY_TREE *root_node = creat_node();
pre_vis(root_node);
}