#include<stdio.h>
#include<stdlib.h>
#define Max 100
struct node
{
char data;
struct node *left,*right;
};
node *create()
{
char ch;
node *t;
scanf("%c",&ch);
if(ch=='#')
t=NULL;
else
{
t=(node*)malloc(sizeof(node));
t->data=ch;
t->left=create();
t->right=create();
}
return t;
}
void pre(node *t)
{
if(t)
{
printf("%c ",t->data);
pre(t->left);
pre(t->right);
}
}
void zhong_xu(node *t)
{
if(t)
{
pre(t->left);
printf("%c ",t->data);
pre(t->right);
}
}
void hou_xu(node *t)
{
if(t)
{
pre(t->left);
pre(t->right);
printf("%c ",t->data);
}
}
int countleaf(node *t)
{
int count=0;
if(!t)
{
return 0;