永发信息网

请帮我修改一个程序,我不知道如何传递参数,我不会修改编译之后提示的错误

答案:1  悬赏:40  手机版
解决时间 2021-05-05 12:30
#include <iostream.h>#include <stdio.h>#include <stdlib.h>
typedef char DataType;typedef struct bnode{ DataType data; struct bnode *lchild,*rchild;}Bnode,*BTree;
Bnode *CreatBinTree(BTree t){ char ch; ch=getchar(); if(ch=='0') t=NULL; else {] t=(Bnode*)malloc(sizeof(Bnode)); t->data=ch; t->lchild=CreatBinTree(t->lchild); t->rchild=CreatBinTree(t->rchild); } return t;}
typedef struct node{ DataType data; struct node *next;}Qnode,*PQNode;typedef struct{ PQNode front,rear;}LinkQueue,*PLinkQueue;
PLQueue Init-LinkQueue(){ PLinkQueue Q; Q=(PLinkQueue)malloc(sizeof(LinkQueue)); if(Q) { Q->front=NULL; Q->rear=NULL; } return Q;}

int Empty-LinkQueue(PLinkQueue Q){ if(Q&&->front==NULL&&Q->rear==NULL) return 1; else return 0;}
int In-LinkQueue(PLinkQueue Q,DataType x){ PQNode p; p=(PQNode)malloc(sizeof(Qnode)); if(!p) { printf("内存溢出!\n"); return 0; } p->data=x; p->next=NULL; if(Empty-LinkQueue(Q)) Q->rear=Q->front=p; else { Q->rear->next=p; q->rear=p; } return 1;}int Out-LinkQueue(PLinkQueue Q,DataType *x){ PQNode p; if(Empty-LinkQueue(Q)) { printf("队空!\n"); return 0; } *x=Q->front->data; p=Q->front; Q->front=Q->front->next; free(p); if(!Q->front) Q->rear=NULL; return 1;}
void LayerOrder(BTree t){ printf("%c\n",t->data); PLinkQueue Init-LinkQueue(); int In-LinkQueue(Q,t); while(Empty-LinkQueue(Q)) { Out-LinkQueue(Q,t); if(!t->lchild) { printf("%c\n",t->lchild); In-LinkQueue(); } if(!t->rchild) { printf("%c\n",t->rchild); In-LinkQueue(); } } LayerOrder(t->lchild); LayeerOrder(t->rchild);}
int main(){ printf("请输入序列:"); BTree t,p; p=CreatBinTree(t); LayerOrder(p); return 0;}
编译之后提示的错误如下:--------------------Configuration: BTree1 - Win32 Debug--------------------Compiling...BTree1.cppF:\Seven\DB\DB 习题\Debug\BTree1.cpp(18) : error C2143: syntax error : missing ';' before ']'F:\Seven\DB\DB 习题\Debug\BTree1.cpp(35) : error C2146: syntax error : missing ';' before identifier 'Init'F:\Seven\DB\DB 习题\Debug\BTree1.cpp(35) : error C2501: 'PLQueue' : missing storage-class or type specifiersF:\Seven\DB\DB 习题\Debug\BTree1.cpp(35) : fatal error C1004: unexpected end of file found执行 cl.exe 时出错.BTree1.obj - 1 error(s), 0 warning(s)
谢谢!!!

最佳答案

你的代码都堆一块去了,很难看清楚,别人就懒得仔细看。


你还是把它整理为好看的格式再贴一次。

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
300元到500元左右的MP5有什么好些的,要可以
战地之王进去怎么显示断开啊
国产的化妆品都有哪些?哪种比较好?
好友把我删了,我怎么删不了他?
英语老师为什么提问多讲题少?
江苏都有那些彩涂板厂!
住所和地址的区别
说谁,谁跑的最快?
爱与被爱你会选什么
这是究竟什么?
这样做是错误的吗?
三千内电脑配置单.主要打游戏
视死如归有什么具体含义?
半岁的宝宝可以多吃点什么呢?除呢牛奶和人奶.
用小灵通发短信开蓝钻,当天就关闭业务,那是
推荐资讯
我要一些关于青春、长大的伤感歌曲、文章、电
我是东莞的神州行用户在惠州拨打是多少钱一分
泉州德育网暑假推荐的16本书是什么?
爱人彼此珍惜的诗句,形容爱人的句子
化肥厂的炉渣能干什么用
天下贰YJ30-39级普通装备哪买
谁能帮我解释“以小人之心度君子之腹”是什么
5000至6000的HP本哪个型号比较好
非常的健康的英语
dota2lin神是不是已经踢出解说名单
请问有没有不用洗的碗?
打雷下雨被惊醒的诗句,描写人被雨淋过后的优
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?