#include<stdio.h> #include<stdlib.h> #include<malloc.h> OK 0 ERROR -1 OVERFLOW -2 DEFSIZE 10 INCREAMSIZE 10 typedef Status; typedef ElemType; typedef ElemType *; ElemType *top; stackSize; realSize; Status InitStack(SqStack & sqstack. = (ElemType*)malloc(DEFSIZE* (!sqstack. sqstack.top = sqstack. sqstack.stackSize = sqstack.realSize = Status Push(SqStack &sqstack,ElemType & (sqstack.top-sqstack.>= sqstack. = (ElemType*)realloc(sqstack.,(sqstack.stackSize+INCREAMSIZE)* (!sqstack. sqstack.top = sqstack. + sqstack.stackSize = sqstack.stackSize + *sqstack.top++ = sqstack.realSize++ Status Pop(SqStack &sqstack,ElemType & (sqstack.== e = *-- sqstack.realSize-- Status GetTop(SqStack &sqstack,ElemType & (sqstack.== e = *(sqstack.top- IsEmpty(SqStack & (sqstack.realSize> Status DestroyStack(SqStack & sqstack.top = sqstack. free(sqstack. sqstack.realSize = sqstack.stackSize = StackLength(SqStack & main( argc, * N = ; temp = ; printf( printf( scanf(,& (N-- scanf(,& printf( printf( printf( printf( scanf(,& }