首页 > 电脑

下面的代码哪了出错了?

更新时间2019-06-22 06:36:28

#include <iostream>using namespace std;#define OK 1#define ERROR 0#define INFEASIBLE -1#define OVERFLOW -2typedef int Status;typedef int SElemType;#define MAXSIZE 100typedef struct StackNode{ SElemType data; struct StackNode *next;}StackNode,*LinkStack;Status InitStack_Link(LinkStack &S){ S=NULL; return OK;}void DestroyStack_Link(LinkStack &S){ LinkStack p=S; while(p) {  S=S->next;  delete p;  p=S; }}bool StackEmpty_Link(LinkStack S){ if(!S) return true; else return false;}//此处定义入栈函数Push_Linkvoid Push_Link(LinkStack &S,SElem Type e){LinkStack p;p=new StackNode;p->datd=e;p->next=S;S=p;}void StackTraverse_Link(LinkStack S){ LinkStack p; p=S; while(p) {  cout<<p->data<<" ";  p=p->next; } cout<<endl;}int main(){ LinkStack S; int n; SElemType e; InitStack_Link(S); cin>>n; for(int i=1;i<=n;i++) {  cin>>e;    //此处调用入栈函数        Push_Link(S,e); } StackTraverse_Link(S); DestroyStack_Link(S); return 0;}


语法上有两个错,改好的

下面的代码哪了出错了?


上一篇:Eplan这个符号怎么画

下一篇:怎么做一个excel的汇总