Problems
Implement a stack
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
stack<int> st;
int m, n, x;
cin>>m;
for(int i = 0; i < m; i++){
cin>>n;
if(n == 1){
cin>>x;
st.push(x);
}
else if (n == 2){
cout<<st.top()<<endl;
st.pop();
}
}
return 0;
}