#include #include using namespace std; template class stack {//class definition private: int *bottom,*top; int size; public: int push(type); int pop(type); stack(int n) {//structore size=n; bottom=new type[size]; top=bottom-1; } `stack() {//destructor delete [] bottom; } }//end of class definition template int stack::push(type x) { if((top-bottom)==size-1) //stack is full return 0; top++; *top=x; return 1; } template int stack::pop(type& x) { if(top==bottom-1) //stack is empty return 0; x=*top; top--; return 1; } int main() { int a; stack sint(20); stack schar(20); int n; cin>>n; sint.push(n); sint.push(15); sint.push(10); sint.push(5); sint.push(100); sint.pop(a); return 0; }