Playground
#include <iostream> #include <stack> using namespace std; int main() { stack<int> numbers; numbers.push(3); numbers.push(5); cout << numbers.top() << endl; //5 numbers.pop(); cout << numbers.top() << endl; //3 numbers.pop(); cout << numbers.size() << endl; //0 return 0; }
Input data
Program output
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!