#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
typedef int Elemtype;
typedef struct LiStack
{
Elemtype data;
struct LiStack *next;
} LiStack;
void InitLiStack(LiStack S){
S.next = NULL;
return true;
}
void PushLiStack(LiStack *S, Elemtype e){
LiStack *top = (LiStack *)malloc(sizeof(LiStack));
if (top == NULL)
return false;
top->data = e;
top->next = S->next;
S->next = top;
return true;
}
void PopLiStack(LiStack *S, Elemtype *e){
if (S == NULL)
return false;
LiStack *temp = S->next;
*e = temp->data;
S->next = temp->next;
free(temp);
return true;
}