fork download
  1. #include<iostream>
  2. #include<iterator>
  3. #include<vector>
  4. using namespace std;
  5. int main()
  6. {
  7. istream_iterator<int> begin_integers(cin);
  8. istream_iterator<int> end_integers;
  9. std::vector<int> ints(begin_integers,end_integers); //read all the integers supplied on stdin and store them in a vector of ints.
  10. return 0;
  11. }
Success #stdin #stdout 0s 2984KB
stdin
4 5 2 1 4 
stdout
Standard output is empty