#include #include #include using namespace std; int main() { vector stos; string komenda; while (komenda != "END") { cin >> komenda; if (komenda == "PUSH") { int liczba; cin >> liczba; stos.push_back(liczba); if (stos.size() == 100) { cout << "error" << endl; return 0; } } else if (komenda == "POP") { if (stos.empty() == true) { cout << "error" << endl; return 0; } else stos.pop_back(); } } for (int i = (stos.size())-1; i>=0; i--) cout << stos[i] << endl; }