栈
1 #include <cstdio> 2 #include <stack> 3 using namespace std; 4 int main() 5 { 6 stack<int> s; 7 s.push(1);//1 8 s.push(2);//1,2 9 s.push(3);//1,2,3 10 cout<<s.top()<<endl;//3 11 s.pop();//1,2 12 cout<<s.top()<<endl;//2 13 s.pop();//1 14 cout<<s.top()<<endl;//1 15 return 0; 16 }