fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. ostream_iterator<string> out_iter(cout, "\n");
  10. istream_iterator<string> in_iter(cin), eof;
  11.  
  12. while ( in_iter != eof ) {
  13. auto tmp = in_iter;
  14. ++in_iter;
  15. *out_iter = *tmp;
  16. }
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3032KB
stdin
123 456 789
stdout
123
456
789