C++ stack 容器
cpp
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<stack>
using namespace std;
void test01()
{
stack<int>s;
s.push(10);
s.push(20);
s.push(30);
s.push(40);
while (!s.empty())
{
cout << "栈顶元素->" << s.top() << endl;
s.pop();
}
}
int main()
{
test01();
return 0;
}