STACK

复制代码
 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cstdlib>
 4 #include <cstring>
 5 #include <iostream>
 6 #include <algorithm>
 7 #include <cmath>
 8 #include <queue>
 9 #include <set> 
10 #include <map>
11 #include <stack>
12 using namespace std;
13 #define  pi acos(-1.0)
14 #define ll long long 
15 #define P pair<ll,ll>
16 #define pu push_back
17 const ll inf = 1e12+100;
18 const int N =2e3+100;
19 stack<int>s;
20 int main()
21 {
22     for(int i =1;i<=5;i++) s.push(i);
23     printf("%d\n",s.size());
24     while(!s.empty()){
25         int u =s.top();
26         s.pop();
27         printf("%d ",u);
28     }
29 }
30 
31 5
32 5 4 3 2 1
复制代码

 

posted on   cltt  阅读(128)  评论(0编辑  收藏  举报

努力加载评论中...
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示