热门

最新

红包

立Flag

投票

同城

我的

发布
suifengdecaicai
随风的菜_鸟
4 年前
truesuifengdecaicai

tdy wsdy^……^

CSDN App 扫码分享
分享
1
点赞
打赏
  • 复制链接
  • 举报
下一条:
#include<stdio.h>#include<malloc.h>#define MaxSize 100typedef char ElemType;typedef struct{ ElemType date[MaxSize]; int top;}SqStack;void InitStack_luoweicheng(SqStack *&s){ s=(SqStack *)malloc(sizeof(SqStack)); s->top=-1;}void DestroyStack_luoweicheng(SqStack *&s){ free(s);}bool StackEmpty_luoweicheng(SqStack *&s){ return (s->top==-1);}bool Push_luoweicheng(SqStack *&s,ElemType &e){ if(s->top==MaxSize-1) return false; s->top++; s->date[s->top]=e; return true;}bool Pop_luoweicheng(SqStack *&s,ElemType &e){ if(s->top==-1) return false; e=s->date[s->top]; s->top--; return true;}bool GetTop_luoweicheng(SqStack *&s,ElemType &e){ if(s->top==-1) return false; e=s->date[s->top]; return true;}
立即登录