⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prog20_09.cpp

📁 一本语言类编程书籍
💻 CPP
字号:
// Program 20.09 Full "random access" Integer iterator  File: prog20_09.cpp
#include <iostream>
#include <algorithm>
#include "Integer.h"
using std::cout;
using std::endl;

int main() {
  Integer F1(-1);
  Integer L1(10);
  cout << "The values [-1..10) in forward order: " << endl; 
  copy (F1, L1, std::ostream_iterator<int>(cout, " "));
  cout << endl;

  typedef std::reverse_iterator<Integer> CountDown;
  CountDown F2(10);
  CountDown L2(-1);
  cout << "the values (10..-1] in reverse order: " << endl; 
  copy (F2, L2, std::ostream_iterator<int>(cout, " "));
  cout << endl;

  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -