7.stack
2024-08-28 10:01:09
#include <iostream>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
using namespace std; void main()
{
//声明栈,默认是deque(因为删除插入效率比较高)
stack<int> mystack;
//声明链式栈
stack<int, list<int>> myliststack;
//声明数组栈
stack<int, vector<int>> myliststack2;
mystack.push();
mystack.push();
mystack.push();
mystack.push(); while (!mystack.empty())
{
cout << mystack.top() << endl;
mystack.pop();
} cin.get();
}
最新文章
- iOS的多版本配置(版本分离,多环境配置)
- junit单元测试(keeps the bar green to keeps the code clean)
- 白话LINQ系列1---什么是LINQ?
- Windows 8.1 应用再出发 (WinJS) - 几种新增控件(2)
- NotifyIcon 将窗口最小化到托盘
- android 学习随笔十六(广播 )
- ruby 学习 -- string --1
- HDU 1042 N!(高精度计算阶乘)
- .net web api 的route理解
- table常用
- WCF技术剖析之二十: 服务在WCF体系中是如何被描述的?
- SQL语句-create语句
- 1013团队Beta冲刺day6
- 【Spring】Spring bean的实例化
- 一些iptables配置
- C++中String类的字符串分割实现
- Spring (一)
- java环境配置错误集锦
- [知识点]C++中STL容器之set
- 01-开始使用django(全、简)
热门文章
- int *p,cons int *p,int const *p,int * const p,const int * const p,int const * const p的差别
- 【LeetCode-面试算法经典-Java实现】【145-Binary Tree Postorder Traversal(二叉树非递归后序遍历)】
- python设计模式 之 简单工厂模式
- IP地址正則表達式
- GitHub客户端和Shell的基本操作和理解
- nyoj--90--整数划分(母函数)
- 详解JSP九个内置对象
- Ubuntu14.04下Mongodb官网卸载部署步骤(图文详解)(博主推荐)
- Linux Screen命令使程序远离断网影响
- linux批处理笔记