第十四周--stl阅读程序
来源:互联网 发布:mac彻底卸载office 编辑:程序博客网 时间:2024/05/23 23:02
问题及代码:
/*copyright计算机与控制工程学院文件名称:stl完成日期:2016/5/31作者:马艳艳*/#include <iterator>#include <list>#include <algorithm>#include <iostream>using namespace std;int main(){ int ia[5] = {1,2,3,4}; list<int> id(ia, ia+4); ostream_iterator<int> outite(cout, " "); copy(id.begin(), id.end(), outite); cout << endl; copy(ia+1, ia+2, front_inserter(id)); copy(id.begin(), id.end(), outite); cout << endl; copy(ia+3, ia+4, back_inserter(id)); copy(id.begin(), id.end(), outite); cout << endl; list<int>::iterator ite = find(id.begin(), id.end(), 3); copy(ia+0, ia+2, inserter(id, ite)); copy(id.begin(), id.end(), outite); cout << endl; copy(id.rbegin(), id.rend(), outite); cout << endl; return 0;}
运行结果:
0 0
- 第十四周--stl程序阅读
- 第十四周--stl阅读程序
- 第十四周阅读程序
- 第十四周 阅读程序
- 第十四周程序阅读
- 第十四周--阅读程序
- 第十四周阅读程序
- 第十四周阅读程序
- 第十四周 阅读程序1
- 第十四周阅读程序2
- 第十四周阅读程序1
- 第十四周阅读程序2
- 第十四周阅读程序3
- 第十四周 阅读程序 1
- 第十四周 程序阅读一
- 第十四周 阅读程序二
- 第十四周 程序阅读三
- 第十四周阅读程序1
- LLDB+debugserver动态调试
- 我的第一个爬虫日志
- gitlab使用
- Android开发之Notification 通知栏
- 闭包解惑
- 第十四周--stl阅读程序
- java 性能调优之内存模型深入详解
- jq删除当前行以及前一行,淘宝购物车
- 新浪微博SDKdemo
- PopupWindow制作Spinner下拉列表
- 矩阵乘法中的高阶计算时间和计算误差问题
- LTE 无线参数 学习
- 【CG物理模拟系列】流体模拟--粒子法之SPH(理论)
- MP4格式分析一