迭代器
来源:互联网 发布:android 离线数据缓存 编辑:程序博客网 时间:2024/06/05 06:30
#include "iostream"
#include "iterator"
using namespace std;
int main(void)
{
cout<<"输出迭代器演示结果\n";
ostream_iterator<int> o(cout,"\t");
*o = 1;
o++;
*o = 2;
o++;
*o = 3;
return 0;
}
#include "iostream"
#include "iterator"
using namespace std;
int main(void)
{
cout<<"请输入数据!\n";
istream_iterator<int> a(cin);
istream_iterator<int> b;
while(true)
{
cout<<*a<<endl;
a++;
if(a == b)
{
break;
}
}
return 0;
}
#include "iterator"
using namespace std;
int main(void)
{
cout<<"输出迭代器演示结果\n";
ostream_iterator<int> o(cout,"\t");
*o = 1;
o++;
*o = 2;
o++;
*o = 3;
return 0;
}
#include "iostream"
#include "iterator"
using namespace std;
int main(void)
{
cout<<"请输入数据!\n";
istream_iterator<int> a(cin);
istream_iterator<int> b;
while(true)
{
cout<<*a<<endl;
a++;
if(a == b)
{
break;
}
}
return 0;
}
0 0
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 迭代器
- 【插件开发二】开发OpenFire的消息拦截器
- 非递归实现二叉树遍历(思路+代码)
- 二分查找算法及其变种
- Python中用encoding声明的文件编码和文件的实际编码之间的关系
- ViewPager Adapter FragmentStatePagerAdapter FragmentPagerAdapter 使用详解
- 迭代器
- POJ 1177 Picture(线段树+扫描线)
- Eclipse OS X Yosemite 提示– To open“Eclipse” you need to install the legacy Java SE 6 runtime的解决办法
- pdo+mysql+php
- mybatis实战教程(mybatis in action),mybatis入门到精通
- saltstack相关的一些总结
- 把以下IP存入一个txt文件,编写程序把这些IP按数值大小,从小到达排序并打印出来。 61.54.231.245 61.54.231.9 61.54.231.246 61.54.231.48
- [Leetcode]Evaluate Reverse Polish Notation
- 【Matlab】小函数