码迷,mamicode.com
首页 > 其他好文 > 详细

hello world,初级水平抄抄代码先看懂

时间:2019-05-07 01:40:42      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:匹配   lse   oid   stdio.h   string   define   clu   tac   ==   

#include #include #include #define MaxSize 100 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int top; }SqStack; void InitStack(SqStack *&s) { s=(SqStack *)malloc(sizeof(SqStack)); s->top=-1; } void DestroyStack(SqStack *s) { free(s); } bool StackEmpty(SqStack *s) { return(s->top==-1); } bool Push(SqStack *s,ElemType e) { if(s->top==MaxSize-1) return false; s->top++; s->data[s->top]=e; return true; } bool Pop(SqStack *s,ElemType &e) { if(-1==s->top) return false; e=s->data[s->top]; s->top--; return true; } bool GetTop(SqStack *s,ElemType &e) { if(-1==s->top) return false; e=s->data[s->top]; return true; } bool Match(SqStack *s,char exp[],int n) { int i=0;char e; bool match=true; InitStack(s); while(ihello world,初级水平抄抄代码先看懂

标签:匹配   lse   oid   stdio.h   string   define   clu   tac   ==   

原文地址:https://www.cnblogs.com/redxi/p/10823110.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!