头文件:
#include<stack>
定义:
stack<int> s1;
stack<string> s2;
基本操作:
s.push(x); //入栈
s.pop(); //出栈,只是删除栈顶元素,并不返回该元素
s.top(); //访问栈顶元素
s.empty(
头文件:
#include<stack>
定义:
stack<int> s1;
stack<string> s2;
基本操作:
s.push(x); //入栈
s.pop(); //出栈,只是删除栈顶元素,并不返回该元素
s.top(); //访问栈顶元素
s.empty(