#include
using namespace std;
const int MAX_SIZE = 100;
//堆栈类
template
class Stack
{
private:
Type list[MAX_SIZE];
int top;//标记
public:
Stack();
void Push(const Type a);//入栈
Type Pop();//出栈
void Clear();//清空栈
Type GetTop();//获取栈顶元素
bool IsEmpty()const;//判断堆栈是否为空
bool IsFull()const;//判断堆栈是否满
};
template
//堆栈初始化
Stack::Stack()
{
top =0;
}
template
//入栈
void Stack::Push(const Type
{
if(top == MAX_SIZE)
return;
list[top++] = a;
}
//出栈
template
Type Stack::Pop()
{
return list[--top];
}