fork(6) download
  1. #include <string>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. const std::string str = "Jhon 12345 R333445 3434";
  7.  
  8. size_t pos = str.find(" ");
  9. if (pos == std::string::npos)
  10. return -1;
  11.  
  12. pos = str.find(" ", pos + 1);
  13. if (pos == std::string::npos)
  14. return -1;
  15.  
  16. std::cout << str.substr(pos, std::string::npos);
  17. }
  18.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
 R333445 3434