建立二叉树无法输出数据是怎么回事儿

建立二叉树输出不了数据怎么办?
我的代码如下:

#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<math.h>
using namespace std;
typedef struct bitree
{ 
int data;  
struct bitree*lchild;
struct bitree*rchild;
}bitree;
bitree*createtree()
{
int a;
bitree*q;
scanf("% d",&a); 
if (a!=0)
{
q=(bitree*)malloc(sizeof(bitree));
q->data=a;
q->lchild=createtree();
q->rchild=createtree();
return q;
}
else
return NULL;
}
void visit(bitree*root)
{printf("%d",root->data);
}
void preOrder(bitree*root)
{if (root!=NULL)
{visit(root);
preOrder(root->lchild);
preOrder(root->rchild);
}
}
void postOrder(bitree*root)
{if(root!=NULL){
    postOrder(root->lchild);
    postOrder(root->rchild);
    visit(root);
}
}
int main()
{
bitree*root=NULL;
root=createtree();
preOrder(root); 
printf("\n");
postOrder(root); 
printf(" \n") ;
}


非常感谢