# Include <iostream> using namespace std; const int SeqStackSize = 100; template <class DataType> class SeqStack {private: int data [SeqStackSize]; /// the int top pointer of the array that stores the stack elements; // The top pointer of the stack, which is the subscript public: SeqStack () {top =-1;} of the stack top element in the array ;} /// constructor, initialize an empty stack ~ SeqStack () {}/// The Destructor is empty void Push (int x); // in the stack operation, add element x into the stack int Pop (); /// stack exit operation. int GetTop () {if (top! =-1) return data [top];} // get the top element of the stack (not deleted) int Empty () {if (top =-1) return 1; else return 0 ;}/// determine whether the stack is empty}; template <class DataType> void SeqStack <DataType >:: Push (int x) // The inbound stack operation, add element x to the stack {if (top = SeqStackSize-1) throw "overflow"; data [++ top] = x ;} template <class DataType> int SeqStack <DataType>: Pop () // stack exit operation. The top element of the stack is displayed {if (top =-1) throw "underflow"; return data [top --];} int main () {return 0 ;}