#include
#include<malloc.h>
#include<string.h>
using namespace std;
#define xiaoyu(a,b)(a<=b)
#define dayu(a,b)(a>b)
typedef struct node
{
struct node* left, * right;
int data;
string name;
}node,tree;
/void insert(tree& T, string s, int a) {
if (xiaoyu(T->data, a))
{
if (T->right == NULL)
{
T->right = (node)malloc(sizeof(node));
T->right->right = NULL;
T->right->left = NULL;
T->right->data = a;
T->right->name = s;
}
else
{
insert(T->right, s, a);
}
}
else
{
if (T->left == NULL)
{
T->left = (node)malloc(sizeof(node));
T->left->right = NULL;
T->left->left = NULL;
T->left->data = a;
T->left->name = s;
}
else
{
insert(T->left, s, a);
}
}
}/
void creattree(tree& T) {
int a;
string s;
cin >> s ;
a = 1;
T = (node)malloc(sizeof(node));
T->data = a;
T->name = s;
T->left = NULL;
T->right = NULL;
/while (a) {
cin >> s ;
insert(T, s, a);
}/
}
int main()
{
tree T;
creattree(T);
}运行为visualc++