fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string S="xywrrmp";
  6. string T="xywrrmr#p";
  7. T.erase(5,6);
  8. cout<<T;
  9. /*int i,j;
  10.   i=j=0;
  11.   while(i<S.length())
  12.   {
  13.   if(S[i]=='#')
  14.   {
  15.   if(i-1==0)
  16.   S.erase(i-1,i+1);
  17.   else
  18.   S.erase(i-1,i);
  19.   i=i-1;
  20.   }
  21.   else
  22.   i=i+1;
  23.   }
  24.   while(j<T.length())
  25.   {
  26.   if(T[j]=='#')
  27.   {
  28.   if(j-1==0)
  29.   T.erase(j-1,j+1);
  30.   else
  31.   T.erase(j-1,j);
  32.   j=j-1;
  33.   }
  34.   else
  35.   j=j+1;
  36.   }
  37.   cout<<S<<" "<<T;
  38.   cout<<S.compare(T);*/
  39. return 0;
  40. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
xywrr