第十四周阅读程序——3
来源:互联网 发布:淘宝远望手机可靠吗 编辑:程序博客网 时间:2024/06/05 17:25
/*Copyright (c) 2016,烟台大学计算机学院
*All rights reserved.
*文件名称 :
*作 者 : 刘亚
*完成日期 : 2016年6月5号
*版 本 号 : v1.0
*
*问题描述 :
*/
#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;
}
*All rights reserved.
*文件名称 :
*作 者 : 刘亚
*完成日期 : 2016年6月5号
*版 本 号 : v1.0
*
*问题描述 :
*/
#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
- 第十四周阅读程序——3
- 第十四周阅读程序——3
- 第十四周阅读程序——1
- 第十四周阅读程序——2
- 第十四周阅读程序——1
- 第十四周阅读程序——2
- 第十四周——阅读程序(3)
- 第十四周阅读程序3
- 第十四周阅读程序3
- 第十四周阅读程序3
- 第十四周(3)-阅读程序
- 第十四周阅读程序
- 第十四周 阅读程序
- 第十四周程序阅读
- 第十四周--阅读程序
- 第十四周阅读程序
- 第十四周阅读程序
- 第十四周阅读程序——例一
- Unity滑动屏幕控制物体的旋转
- 第十四周阅读程序——2
- 美赛论文格式
- Android 使用WebService
- android 隐藏系统键盘
- 第十四周阅读程序——3
- java注解
- C++在重载operator=为带模板的函数的时候的陷阱
- How to write a good bug report
- angularjs 2的开发中遇到的bug之一
- 华为短信开发包开发联通sgip1.2接口协议报错
- 财务凭证的替代
- Failed to create 'build\outputs\apk\watch-debug-unaligned.apks': 拒绝访问。
- 每日一得--JNDI 是什么