Problem1381--另类堆栈

1381: 另类堆栈

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

在栈的顺序存储实现中,另有一种方法是将Top定义为栈顶的上一个位置。请编写程序实现这种定义下堆栈的入栈、出栈操作。如何判断堆栈为空或者满? 函数接口定义: bool Push( Stack S, ElementType X ); ElementType Pop( Stack S ); 其中Stack结构定义如下: typedef int Position; typedef struct SNode *PtrToSNode; struct SNode { ElementType *Data;

Input

堆栈S,操作元素x

Output

堆栈S,操作元素x

Sample Input Copy

4
Pop
Push 5
Push 4
Push 3
Pop
Pop
Push 2
Push 1
Push 0
Push 10
End

Sample Output Copy

Stack Empty
3 is out
4 is out
Stack Full
0 1 2 5

Source/Category