栈
来源:互联网 发布:epson照片打印软件 编辑:程序博客网 时间:2024/06/06 05:02
#include<iostream>#include<cstdio>#include<stack>using namespace std;int main(){ stack<int>s; int a=1,b=2,c=3; s.push(a); // 进栈 s.push(b); s.push(c); s.pop(); // 出栈 cout<<s.top(); // 返回栈首元素的值 cout<<s.size(); // 返回栈的元素的个数 cout<<s.empty(); // 判断栈是否为空 为空则返回1 return 0;}
0 0
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- 栈
- Yii中CGridView单元格组件和数据提供者的使用
- 一个整理桌面的python小例子
- 基于友善的superboot 移植linux内核到tiny210(s5pv210)上
- 解决Android4.3版本下,手机短彩接收中文文件名附件,中文名字的附件无法保存(第一步:解决从网络下载附件后,持久化时中文文件名中文乱码)
- 【LeetCode】Merge Intervals && Insert Interval
- 栈
- 浪潮ERP-PS异速联远程接入解决方案
- Protocol buffer使用
- kali-linux入门使用
- Font '宋体' is not available to the JVM. See the Javadoc for more details.
- tcmalloc win32原理
- 【不明觉厉,厚积薄发】ARM_linux(十四)
- Servlet 入门
- 关于VC画图闪屏的问题 - VC/MFC / 基础类