不知道为什么建立二叉树是终止不了循环



```c
#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, sy
```c



```stem("pause") or input loop */
typedef struct  BitNode {
    char  data;
    struct BitNode *lchild, *rchild;
} BitNode, *BiTree;

BiTree CreateBiT(BiTree T) { //先序建立
    int ch = 0;
    scanf("%d", &ch);
    if (ch == 9) {
        T = NULL;
        printf("od");
        return T;
    } else {
        T = (BiTree)malloc(sizeof(BitNode));
        T->data = ch;
        T->lchild = CreateBiT(T->lchild);
        T->rchild = CreateBiT(T->rchild );

    }

}

void Preorder(BiTree T) { //先序遍历
    if (T) {

        printf("%d", T->data);
        Preorder(T->lchild);
        Preorder(T->rchild);
    } else
        return;
}

void Midorder(BiTree T) { //中序遍历
    if (T) {
        Preorder(T->lchild);
        printf("%d", T->data);
        Preorder(T->rchild);
    } else
        return;
}

int max(int a, int b) {
    return (a >= b ? a : b);
}

int depth(BiTree T) { //二叉树的深度
    if (T)
        return 1 + max(depth(T->lchild), depth(T->rchild));
    else
        return 0;
}

int main(int argc, char *argv[]) {
    BitNode *root;
    root = CreateBiT(root);
    printf("id");
    Preorder(root);
    //  Midorder(root);
    printf("d=%d", depth(root));
    return 0;
}

```