fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7. std::string str = "15 50 91";
  8.  
  9. std::istringstream instr(str);
  10. std::string w;
  11.  
  12. while (instr >> w)
  13. std::cout << w << std::endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 2816KB
stdin
Standard input is empty
stdout
15
50
91