MickyOr

Untitled

Apr 22nd, 2017
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.   string a, b; // a -> cadena original
  8.                // b -> cadena a eliminar
  9.   cin >> a >> b;
  10.   string res;
  11.   for (int i = 0; i < a.size() - b.size() + 1; i++)
  12.   {
  13.     if (a.substr(i, b.size()) == b) i += b.size() - 1;
  14.     else res += a[i];
  15.   }
  16.   cout << res;
  17. }
RAW Paste Data