//geneeriline pinu klass, tehtud näite 6.8 põhjal // #include using namespace std; const int iSize=100; // Generic template template class TStack { private: TStackType Q[iSize]; int Start; int End; public: TStack(){ Start=iSize; End=iSize; } void Put(TStackType i); TStackType Get(void); }; template void TStack::Put(TStackType _input) { if(Start==0){ cout << "Stack is full" << endl; return; } Start--; Q[Start] = _input; } template TStackType TStack::Get(void) { if(Start==End){ cout << "Underflow" << endl; return 0; }else{ Start++; return Q[Start-1]; } } int main(void) { TStack qA; TStack qS; TStack qF; qA.Put('s'); qA.Put('k'); qA.Put('y'); qA.Put('l'); qA.Put('l'); qA.Put('u'); qA.Put('N'); qS.Put("Üks "); qS.Put("Kaks "); for(int i=0; i<=iSize; i++)qF.Put((float)i); cout<