给定栈的结构体,在主函数中完成数组元素倒置

【问题描述】给定栈的结构体,试按要求完成栈的判空、判满、出栈、入栈、统计栈元素个数函数功能,并在主函数中完成数组元素倒置。
【输入形式】从键盘输入n(n<20),然后输入n个数
【输出形式】倒序输出数值
【样例输入】 4
1 2 3 4
【样例输出】4 3 2 1

#include "stdio.h"
#include "stdlib.h"
#include "string.h"

#define OK 1
#define ERROR 0
#define INIT_SIZE 10
#define INCREM 5

typedef int ElemType;
typedef struct stack
{
    ElemType *base;
    ElemType *top;
    int stacksize;
}SqStack;

int InitStack(SqStack *s);
int PushStack(SqStack *s,ElemType e);
ElemType PopStack(SqStack *s);
int IsEmptyStack(SqStack *s);
int IsFullStack(SqStack *s);
int Count(SqStack *s);

int main()
{
    SqStack st;
    int n;
    ElemType a[21];
    int i;
    InitStack(&st);
    scanf("%d",&n);
    if(n<=0)
        return ERROR;
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    {
        PushStack(&st,a[i]);
    }
    for(i=0;i<n;i++)
    {
        a[i]=PopStack(&st);
    }
    for(i=0;i<n;i++)
        printf("%d ",a[i]);
    return OK;
}

int InitStack(SqStack *s)
{
    s->base=(ElemType *)malloc(sizeof(ElemType )*INIT_SIZE);
    if(!s->base)
        return ERROR;
    s->top=s->base;
    s->stacksize=INIT_SIZE;
    return OK;
}

int IsEmptyStack(SqStack *s)
{
    if(s->top==s->base)
        return OK;
    else
        return ERROR;

}
int IsFullStack(SqStack *s)
{
    if(s->top==INIT_SIZE-1)
    {
        return OK;
    }
    else
    {
        return ERROR;
    }
}

int  PushStack(SqStack *s,ElemType e)
{
    if(s->top-s->base>=s->stacksize)
    {
        s->base=(ElemType *)realloc(s->base,(s->stacksize+STACKINCREMENT)*sizeof(ElemType));
        if(!s->base)
            return ERROR;
        s->top=s->base+s->stacksize;
        s->stacksize+=STACKINCREMENT;
    }
    * s->top++=e;
    return OK;
}

ElemType PopStack(SqStack *s)
{
    ElemType e;
    if(s->top==s->base)
    {
        return ERROR;
    }
    s->top=s->top-1;
    *e=*s->top;
    return OK;

}

int Count(SqStack *s) //就这边统计栈元素个数不会写,其他应该都没啥问题
{

}