stack

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <stack>
 4 #include <algorithm>
 5 using namespace std;
 6 int main()
 7 {
 8     stack <int> s;
 9     s.push(1);
10     s.push(2);
11     s.push(3);
12     printf("%d
",s.top());
13     s.pop();
14     printf("%d
",s.top());
15     s.pop();
16     printf("%d
",s.top());
17     return 0;
18 }
View Code
原文地址:https://www.cnblogs.com/cyd308/p/4771327.html