#includeusing namespace std; //顺序栈的实现 typedef struct{ int data[1000]; int top; }SqStack; //初始化栈 void InitStack(SqStack &S){ S.top = -1; } //判断栈是否为空 bool StackEmpty(SqStack S){ if(S.top == -1) return true; else return false; } //入栈 void Push(SqStack &S, int x){ if(S.top == 999) cout<<"栈满"< output:



