fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <functional>
  4. #include <iterator>
  5. #include <vector>
  6. #include <string>
  7. #include <list>
  8. #include <forward_list>
  9.  
  10. using namespace std::placeholders;
  11.  
  12. bool check(const std::string &s, std::string::size_type sz)
  13. {
  14. return s.size() >= sz;
  15. }
  16.  
  17. int main()
  18. {
  19. std::vector<int> v;
  20. std::istream_iterator<int> int_it(std::cin);
  21. std::istream_iterator<int> eof;
  22.  
  23. while (int_it != eof)
  24. v.push_back(*int_it++);
  25.  
  26. for (auto &i : v)
  27. std::cout << i << " ";
  28. std::cout << std::endl;
  29. }
Success #stdin #stdout 0s 3416KB
stdin
1 2 3 4 5
stdout
1 2 3 4 5