#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
typedef int Elemtype;
#define MaxSize 10
typedef struct SqStack
{
Elemtype data[MaxSize];
int top;
} SqStack;
void InitSqStack(SqStack S){
S.top = -1;
return true;
}
void IsEmptySqStack(SqStack S){
if (S.top == -1)
return true;
else
return false;
}
void PushSqStack(SqStack S, Elemtype e){
if (S.top == (MaxSize - 1))
return false;
S.data[++S.top] = e;
return true;
}
void PopSqStack(SqStack S, Elemtype e){
if (S.top == -1)
return false;
e = S.data[S.top--];
return true;
}
void GetPopSqStack(SqStack S, Elemtype e){
if (S.top == -1)
return false;
e = S.data[S.top];
return true;
}