亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

C++代碼出錯

C++代碼出錯

C++
qq_蝶戀花_9 2017-06-01 20:30:58
#include "LinkQueue.h"#include "LinkStack.h"int main()?{? ?TreeNodePtr BT;? ?TreeNodePtr CreateBitree();? ?int BiTreeTranc(TreeNodePtr);? ?printf("Input:\n");? ?BT= CreateBitree();? ?BiTreeTranc(BT);? ?return 0;?}TreeNodePtr CreateBitree(){? ?LinkQueue q;? ?TreeNodePtr bt, p, R;? ?char a, b, S;? ?InitQueue(&q);? ?bt=NULL;? ?printf("請輸入節點的雙親、節點及LR標記值:");? ?scanf("%c", &a);? ?scanf("%c", &b);? ?scanf("%c", &S); while (b!='#')? ?{ p= (TreeNodePtr)malloc(sizeof(TreeNodePtr)); p->data= b; p->Lch= NULL; p->Rch= NULL; if (a=='#') { bt= p; EnQueue(&q, p); } else { GetHead_Q(q, &R); while(R->data!= a) { ? DeQueue(&q, &R); GetHead_Q(q, &R); ? } if (S=='L') { R->Lch= p; } else { ? R->Rch= p; DeQueue(&q, &R); ? } EnQueue(&q, p); } printf("請輸入節點的雙親、節點及LR標記值:"); scanf("%c", &a); while(a =='\n')? scanf("%c", &a);;? scanf("%c", &b); scanf("%c", &S);? ?} return bt; } int BiTreeTranc(TreeNodePtr BT) { ?LinkStack S; ?TreeNodePtr p; ?printf("Output:\n"); printf("該二叉樹的前序遍歷結果為:");? ?? InitStack(&S); ClearStack(&S); p=BT; ?while(1) ?{ ? if (p==NULL) ? { ? if (StackIsEmpty(&S)) ? { ? printf("\n"); ? return 0; ? } ? else ? { ? Pop(&S, &p); ? p= p->Rch; ? } ? } ? else ? { printf("%c", p->data); Push(&S, p); p= p->Lch; ? }? ?} }運行報錯如下:doubletreef.cppe:\course\c++\doubletreef.cpp(1) : fatal error C1083: Cannot open include file: 'LinkQueue.h': No such file or directoryError executing cl.exe.doubletreef.obj - 1 error(s), 0 warning(s)求高手指點
查看完整描述

1 回答

?
慕粉2356025026

TA貢獻2條經驗 獲得超0個贊

沒有找到頭文件,檢查下是拼寫錯誤,還是不在同一路徑下
查看完整回答
反對 回復 2017-07-10
  • 1 回答
  • 0 關注
  • 1271 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號