栈:先进后出
#include<stack> #include<cstdio> using namespace std; int main() { stack<int> s; s.push(1);//{}->{1} s.push(2);//{1}->{1.2} printf("%d\n",s.top());2 s.pop();//从栈顶移除{1,2,3}->{1,2} printf("%d\n",s.top()); return 0; }