fork(2) download
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. int main()
  5. {
  6. std::string str = "10 11 12 13 14";
  7. std::istringstream input(str);
  8. std::ostringstream output;
  9. for(int n; input >> n; )
  10. output << n*10 << ' ';
  11. str = output.str();
  12. std::cout << str << '\n';
  13. }
  14.  
Success #stdin #stdout 0s 2860KB
stdin
Standard input is empty
stdout
100 110 120 130 140