#include#define MaxSize 10 typedef struct{ int data[MaxSize]; int top; //栈顶指针 }SqStack; //初始化栈 void InitiStack(SqStack &S) { S.top=-1; } bool Empty(SqStack &S) { if(S.top==-1) return true; return false; } //入栈 bool Push(SqStack &S,int x){ if(top==MaxSize-1) return false; S.data[++S.top]; return true; } //出栈 bool Pop(SqStack &S, &x){ if(S.top==-1) return false; x = S.data[S.top--]; return true; } //读取站定元素 bool Read(SqStack &S, &x) { if(S.top==-1) return false; x=S.data[top]; return true; } int main(void) { return 0; }



