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 }
View Code
posted @ 2018-12-30 17:59  wydxry  阅读(254)  评论(0编辑  收藏  举报
Live2D