#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <iterator>
int main()
{
cout << "Enter two integers: ";
std::istream_iterator< int > inputInt( cin );
int number1 = *inputInt;
++inputInt;
int number2 = *inputInt;
std::ostream_iterator< int > outputInt( cout );
cout << "The sum is: ";
*outputInt = number1 + number2;
cout << endl;
return 0;
}
|