fork(5) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iterator>
  4. #include <string>
  5. #include <sstream>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. string str = "hello world this is some text";
  12. stringstream ss(str);
  13.  
  14. transform(istream_iterator<string>(ss),
  15. istream_iterator<string>(),
  16. ostream_iterator<string>(cout, "\n"),
  17. [](const string &w) { return string(w.rbegin(), w.rend()); }
  18. );
  19. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
olleh
dlrow
siht
si
emos
txet