fork(1) download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7.  
  8. string str="rooroooro";
  9.  
  10. int i;
  11.  
  12. for(i=0;i<str.size();i++){
  13.  
  14.  
  15. if(str[i]=='o'){
  16.  
  17.  
  18. str.erase(str.begin()+i);
  19.  
  20. i--;
  21.  
  22. }
  23.  
  24.  
  25.  
  26. }
  27.  
  28.  
  29. cout<<str<<"\n";
  30.  
  31.  
  32.  
  33. return 0;
  34. }
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
rrr