Advertisement
fimas

Standard Copy

May 14th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <iterator>
  3. #include <algorithm>
  4. #include <vector>
  5.  
  6. int main()
  7. {
  8.     std::vector<std::string> v;
  9.    
  10.     std::copy(
  11.         std::istream_iterator<std::string>(std::cin),
  12.         std::istream_iterator<std::string>(),
  13.         std::back_inserter(v)
  14.     );
  15.  
  16.     std::copy(
  17.         v.begin(),
  18.         v.end(),
  19.         std::ostream_iterator<std::string>(std::cout, " ")
  20.     );
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement