
又仔细看了原题,就算这样写可行,实际中看的人也太费解
觉得楼主的一开始的定义好像不太符合常规(不是不对)										

#include<stdlib.h>
#include<iostream.h>
typedef struct btnode{
        char v;
  struct btnode *lchild,*rchild;
}BTnode;
BTnode * creat()
{
 int i,j;
    char x;
    BTnode *head=NULL,*p,*sex[31];
 cout<<"请输入二叉树的元素结点"<<endl; 
 cout<<"i=,x=";
 cin>>i>>x;
    while(i!=0&&x!='$')
 {
     p=(BTnode *)malloc(sizeof(BTnode));
  p->v=x;p->lchild=NULL;p->rchild=NULL;
  sex[i]=p;
  if(i==1)
  head=p;
  else
  {
      j=i/2;
   if(i%2==0)
    sex[j]->lchild=p;
   else
    sex[j]->rchild=p;
  }
  cout<<"i=,x=";
    cin>>i>>x;
 }
    return head;
}
