#include
#include
typedef int Position;
typedef struct SNode
{
    Position* arry;//动态数组
    Position Maxsize;//最大值
    Position tag;//数组的下标
    Position data;//该数据
}Snode;
Snode* Creat(Position Maxsize)//创建这个堆栈
{
    Snode* p;
    p = (Snode*)malloc(sizeof(Snode));//来一个指针指向这个结构体
    p->arry = (int*)malloc(Maxsize * sizeof(Position));//创建动态数组的数据
    //p->arry[n]=x;可以在此赋值
    p->Maxsize = Maxsize;
    p->tag = -1;
    return p;
}
bool Isfull(Snode* p)//往堆栈放时注意是否满了
{
    if (p->tag == p->Maxsize - 1)
        return false;
    else
        return true;
}
bool Isempty(Snode* p)//注意空
{
    if (p->tag == -1)
        return -1;
    else
        return 1;
}
Snode* Push(Snode* p,Position X)
{
    if (Isfull)
    {
        p->arry[++(p->tag)] = X;
    }
    else printf("full");
}
int Pop(Snode* p)
{
    if (Isempty(p))
        return  p->arry[(p->tag)--];
    else
        printf("isempty");
}