顺序容器 list 2
来源:互联网 发布:java 短信验证码 编辑:程序博客网 时间:2024/05/22 16:45
#include <iostream>#include <list>using namespace std;void PrintListContents(const list<int>& listInput);int main(){list<int> a;a.push_front(3);a.push_front(6);list<int>::iterator iElementValueTwo;iElementValueTwo = a.insert(a.begin(),31);a.push_front(12);PrintListContents(a);a.sort(); // sort 是排序,PrintListContents(a);a.reverse(); //reverse是翻转,PrintListContents(a);//a.erase(iElementValueTwo); // erase删除,//PrintListContents(a);a.erase(a.begin(),iElementValueTwo);PrintListContents(a);return 0;}void PrintListContents(const list<int>& listInput){list<int>::const_iterator iter;for(iter = listInput.begin(); iter != listInput.end(); ++iter)cout << *iter << " ";cout << endl;}
0 0
- 顺序容器 list 2
- 顺序容器list vector
- 顺序容器之list
- STL顺序容器-list
- 顺序容器 list
- 顺序容器之list
- C++容器-2顺序容器vector、list、deque的使用
- 顺序容器STL::list用法
- Chapter 7.顺序容器list
- STL-顺序容器-列表list
- C++容器--- 顺序性容器<list>
- stl 顺序容器vector(priority_queue),顺序容器List,顺序容器deque(queue, stack)详解
- 由浅入深-顺序容器(vector deque list)
- 顺序容器(Vector和List)
- STL-顺序容器学习:list
- C++顺序容器vector、deque、list
- 顺序容器vector、list、deque的区别
- 顺序容器list、vector、deque的优劣
- leetcode-构造二叉树
- Myeclipse2014 安装反编译插件
- 准备毕业论文写Python的中文编码问题
- Storm的并行度详解
- 使用Masonry报unrecognized selector sent to instance的错
- 顺序容器 list 2
- RGB to Gray
- 有两个序列a,b,大小都为n,序列元素的值任意整数,无序; 要求:通过交换a,b中的元素,使[序列a元素的和]与[序列b元素的和]之间的差最小。
- mac下SVN服务器命令行
- Controller设计
- 利用OpenSSL库对Socket传输进行安全加密
- shell脚本学习笔记 (流编辑器sed)
- 栈的数组表示
- Java设计模式(二) Decorator(装饰)模式及Java I/O引申