#include const int DIM_MAX = 100; template class PILA {private: T *A; int TOP; public: PILA() {A = new T[DIM_MAX]; TOP = 0;} void PUSH(T x); T POP(); int EMPTY();}; template void PILA::PUSH(T x) {if (TOP == DIM_MAX) cout << "pila piena!" ; else {A[TOP] = x; ++TOP;}} template T PILA::POP() {--TOP; return A[TOP];} template int PILA::EMPTY() {if (TOP == 0) return 1; else return 0; } int main() { PILA P1; PILA P2; P1.PUSH('a'); P2.PUSH('b'); cout << P2.POP() << endl; return 0; }