#include #include using namespace std;const int maxn=500;typedef struct { int data[maxn]; int top;}Stack;//初始化stackvoid init(Stack *&s){ s=(Stack *)malloc(sizeof(Stack)); s->top=-1;}//销毁stackvoid destroy(Stack *&s){ free(s);}//判断栈是否为空bool empty(Stack *s){ return (s->top==-1);}//进stackvoid push(Stack *&s,int e){ if(s->top==maxn-1) { cout<<"栈满,不能插入!"< top++; s->data[s->top]=e;}//出stackvoid pop(Stack *&s,int get){ if(s->top==-1) { cout<<"栈为空,没有元素出栈!"< data[s->top]; s->top--;}//获取栈顶元素int top(Stack *&s,int get){ if(s->top==-1) { cout<<"栈为空,没有元素出栈!"< data[s->top]; return get;}int main(){ return 0;}