目录
[创建stack name](#创建stack name)
创建stack<tp> name
访问。top()
和queue or priority q类似,这种数据结构形的,访问都不那么自由

添加元素。push()
有些不解哦
哦,又是那个错误,你删着删着,stk.size也在变小。。

删除元素。pop()
判空。empty()
元素个数。size()
用途
代码
cpp
#include <cstdio>
#include <queue>
#include <vector>
#include <set>
#include <string>
#include <iostream>
#include <map>
#include <stack>
using namespace std;
stack<int> stk;
int main()
{
// fruit
stk.push(3);
stk.push(1);
stk.push(3);
stk.push(8);
int n=stk.size();
for(int i=0;i<n;i++)
cout<<stk.top(),stk.pop();
}