fork download
  1. #include <string>
  2. #include <algorithm>
  3. #include <iostream>
  4. #include <cctype>
  5.  
  6. int main()
  7. {
  8. std::string s = "ewzge242jfdsiii23";
  9. auto pr = std::stable_partition(s.begin(), s.end(), ::isdigit);
  10. std::cout << s.substr(0,4);
  11. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
2422