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

📄 fig20_05.cpp

📁 经典vc教程的例子程序
💻 CPP
字号:
// Fig. 20.5: fig20_05.cpp
// Demonstrating input and output with iterators.
#include <iostream>
#include <iterator>

using namespace std;

int main()
{
   cout << "Enter two integers: ";

   istream_iterator< int > inputInt( cin );
   int number1, number2;

   number1 = *inputInt;  // read first int from standard input
   ++inputInt;           // move iterator to next input value
   number2 = *inputInt;  // read next int from standard input

   cout << "The sum is: ";

   ostream_iterator< int > outputInt( cout );

   *outputInt = number1 + number2;  // output result to cout
   cout << endl;
   return 0;
}

⌨️ 快捷键说明

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