栈:先进后出
#include<stack>
stack<int> temp;
temp.pop():移除栈顶元素。
temp.push():在栈顶增加元素。
temp.empty():栈为空返回真。
temp.top():返回栈顶元素。
temp.size():返回栈中元素数目。
如果想让stack底层容器为list
stack<int, list<int>> istack;
函数如上正常使用。
Copyright @ 2024 眷恋你的方圆 Powered by .NET 8.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster