fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iterator>
  4. #include <vector>
  5.  
  6. int main()
  7. {
  8. std::vector<int> nums((std::istream_iterator<int>(std::cin)),
  9. std::istream_iterator<int>());
  10.  
  11. // nums is now loaded. use it however you want.
  12. std::copy(nums.begin(), nums.end(), std::ostream_iterator<int>(std::cout, "\n"));
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 3476KB
stdin
4
8 2
5 6
8 2
2 3
stdout
4
8
2
5
6
8
2
2
3