#include <iostream>
#include <stack>
using namespace std;
/*
size() 返回栈的元素个数
top() 返回栈顶的元素
pop() 从栈中取出并删除元素
push(x) 向栈中添加元素x
empty() 在栈为空时返回true
*/
int main()
{
stack<int> s;
//1.push(x) 向栈中添加元素x
s.push(3);
s.push(7);
s.push(1);
s.push(2);
//2.size() 返回栈的元素个数
cout << "size = " << s.size() << endl;
//3.top() 返回栈顶的元素
cout << "top = " << s.top() << endl;
//4.pop() 从栈中取出并删除元素
s.pop();
cout << "pop_top = " << s.top() << endl;
//5.push(x) 向栈中添加元素x
s.push(5);
cout << "push_top = " << s.top() << endl;
return 0;
}