fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. istream_iterator<string> it(cin), eof;
  9. vector<string> words;
  10.  
  11. copy(it, eof, back_inserter(words));
  12.  
  13. for (auto i = words.begin(); i != words.end(); ++i) cout << *i << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3024KB
stdin
These are
some   words
stdout
These
are
some
words