template<class T>
class Stack
{
private:
int top;
int MaxTop;
T *stack;
public:
Stack(int MaxStackSize);
~Stack(){delete[] stack;}
int IsEmpty()const {return (top==-1)?1:0;}
int IsFull()const {return (top==MaxTop)?0:1;}
T Top();
Stack<T>&Add(const T&x);
Stack<T>&Delete(T&x);
};
template<class T>
class Stack
{
private:
int top;
int MaxTop;
T *stack;
public:
Stack(int MaxStackSize);
~Stack(){delete[] stack;}
int IsEmpty()const {return (top==-1)?1:0;}
int IsFull()const {return (top!=MaxTop)?0:1;}
T Top();
Stack<T>&Add(const T&x);
Stack<T>&Delete(T&x);
};