fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <sstream>
  4. #include <algorithm>
  5. #include <vector>
  6. using namespace std;
  7.  
  8. int main() {
  9. string data = "quick brown fox jumps over the lazy dog";
  10. stringstream input(data);
  11. vector<string> res;
  12. copy(
  13. istream_iterator<string>(input)
  14. , istream_iterator<string>()
  15. , back_inserter(res));
  16. for (int i = 0 ; i != res.size() ; i++)
  17. cout << '"' << res[i] << '"' << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
"quick"
"brown"
"fox"
"jumps"
"over"
"the"
"lazy"
"dog"