#ifndef STACK_H #define STACK_H #include #include #include template class Stack { public: void push(T n){ s.push_back(n); } T pop(){ assert( ! empty()); T r=s.back(); s.pop_back(); return r;} T top() const { assert( ! empty() ); return s.back();} bool empty() const { return s.size()==0; } private: vector s; }; // Stack #endif