// AED 2024/2025 [Pedro Ribeiro - DCC/FCUP] // An example usage of STL stacks #include #include using namespace std; int main() { // Example list of integers stack st; cout << "Stack size: " << st.size() << endl; st.push(2); st.push(4); st.push(6); st.push(8); cout << "Stack size: " << st.size() << endl; while (!st.empty()) { cout << "At the top: " << st.top() << endl; st.pop(); } cout << "Stack size: " << st.size() << endl; // A stack can be of any type stack st2; stack st3; stack st4; return 0; }