stack<int>stk;
stk.push(elem)
stk.pop()
stk.top()
stk.empty()
stk.size()
#include<iostream>
using namespace std;
#include<stack>
void test01()
{
stack<int>stk;
stk.push(10);
stk.push(20);
stk.push(30);
stk.push(40);
stk.push(50);
cout << "栈的大小:" << stk.size() << endl;
while (!stk.empty())
{
cout << stk.top() << " ";
stk.pop();
}
cout << endl;
cout << "全部出栈后,栈的大小:" << stk.size() << endl;
}
int main()
{
test01();
system("pause");
return 0;
}