Status InitStack(LinkStack &S);//初始化栈
Status Push(LinkStack &S,ElemType e);//将元素e压入栈S
Status Pop(LinkStack &S,ElemType &e);//将元素e压出栈s
int main()
{
LinkStack S = new stack;
InitStack(S);
int length;
ElemType e;
printf("请输入你要存储的字符数:");
scanf("%d",&length);
printf("请输入你要存储的字符:");
for(int i = 0;i<length;i++)
{
printf("\n");
e = getch();//隐试输入
printf("%c",e);
Push(S,e);
}
ElemType elem[100];
if((length%2)==0)//若长度为偶数则出栈一半长度个元素
{
for(int i = 0 ;i<length/2;i++)
{
Pop(S,elem[i]);