fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. string s = "1_2_rec2";
  7. int id = stoi(string(s.begin()+s.find("rec")+3, s.end()));
  8. cout << id;
  9. return 0;
  10. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
2