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 ",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