/* HELLO.C -- Hello, world */
#include "stdio.h"
#include "conio.h"
#include <String.h>
typedef char DataType;
typedef struct {
int data[100];
int top;
}SeqStack,*PSeqStack; /*定义栈*/
PSeqStack Init_SeqStack()
{
PSeqStack S;
S=(PSeqStack)malloc(sizeof(SeqStack));
if(S)
S->top=-1;
return S;
}/*初始化栈*/
int Push_SeqStack(PSeqStack S,int x)
{
if(S->top==99)
return 0;
else
{
S->top++;
S->data[S->top]=x;
return 1;
}
}/*元素入栈*/
int Pop_SeqStack(PSeqStack S,int *x)
{
if(Empty_SeqStack(S))
return 0;
else
{
*x=S->data[S->top];
S->top--;
return 1;
}
}/*元素出栈*/
void Destory_SeqStack(PSeqStack *S)
{
if(*S)
free(*S);
*S=NULL;
return;
} /*销毁栈*/
int Empty_SeqStack(PSeqStack S)