c++ stl栈stack的头文件为:
#include<stack>
stack<int> S;//声明一个对象
S.empty();//栈空返回true 否则false
int x=S.size();//返回栈中元素个数于x
S.pop();//移除栈顶元素
S.push(x);将x置于栈顶
x=S.top();返回栈顶元素
文章转载于:https://blog.csdn.net/qq_24286723/article/details/50037479?locationNum=1&fps=1