| 7 | #define endl '\n' |
| 8 | |
| 9 | int main(){ |
| 10 | cin.tie(0)->sync_with_stdio(0); |
| 11 | stack<int> st; |
| 12 | st.push(1); |
| 13 | st.push(3); |
| 14 | st.push(3); |
| 15 | st.push(3); |
| 16 | st.emplace(12); |
| 17 | |
| 18 | cout << st.top() << endl; |
| 19 | |
| 20 | st.pop(); |
| 21 | |
| 22 | cout<<st.top()<<endl; |
| 23 | |
| 24 | cout<<st.size()<<endl; |
| 25 | |
| 26 | cout<<st.empty()<<endl; |
| 27 | |
| 28 | //swaping stack |
| 29 | stack<int> st1; |
| 30 | st1.swap(st); |
| 31 | |
| 32 | return 0; |
| 33 | } |