#include<iostream>using namespace std;#define Stack_Size 100typedef struct{int *elem;int top;int base;int stacksize;}sqStack;void initStack(sqStack &S)//顺序栈初始化{S.elem=new int[Stack_Size];S.top=S.base=0;S.stacksize=Stack_Size;}void creatStack(sqStack &S,int n)//顺序栈建立{initStack(S);//初始化栈int i;for(i=0;i<n;i++){S.top++;}}void destoryStack(sqStack &S)//销毁栈{delete []S.elem;S.top--;S.stacksize=0;}void pushStack(sqStack &S,int x)//入栈{S.elem[S.top++]=x;}int popStack(sqStack &S)//出栈{int x;if(S.top==S.base){printf("error!");}else{x=