没有错误,为什么不能运行,请指教
#include<stdio.h>#include<malloc.h>
typedef struct node
{
int data;
struct node *lchild,*rchild;
}BT;
BT* createtree()
{
BT *bt;
char x;
scanf("%c",&x);
if(x=='0')bt=NULL;
else
{
bt=(BT*)malloc(sizeof(BT));
bt->data =x;
bt->lchild =createtree();
bt->rchild =createtree();
}
return bt;
}
int main()
{
int i;
while(1)
{
printf("\n\t\t\t* * * * * * * * * * * * * * * * * * * *");
printf("\n\t\t\t 1.建树");
printf("\n\t\t\t 2.");
printf("\n\t\t\t 3.");
printf("\n\t\t\t 4.");
printf("\n\t\t\t 5.");
printf("\n\t\t\t 6.");
printf("\n\t\t\t 7.");
printf("\n\t\t\t 8.");
printf("\n\t\t\t 0.");
printf("\n\t\t\t* * * * * * * * * * * * * * * * * * * *");
printf("\n请输入你要进行的操作序号(0---9):");
scanf("%d",i);
switch(i)
{
case 1:createtree();break;
case 2:break;
case 3:break;
case 4:break;
case 5:break;
case 6:break;
}
}
return 0;
}