SHARE
TWEET

Untitled

a guest Dec 12th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. using namespace std;
  5. int main ()
  6. {
  7.     int k=0;
  8.     string s;
  9.     string s0;
  10. string::size_type pos=0;
  11.     cout<<"s=";
  12.     getline(cin,s);
  13.     cout<<"s0=";
  14.      getline(cin,s0);
  15.     string::size_type n=s.find(s0,pos);
  16.    while (n!=string::npos)
  17.    {
  18.        s.erase(n,s0.size());
  19.        pos=n;
  20.        n=s.find(s0,pos);
  21.        
  22.    }
  23.     cout<<s<<endl;
  24.     return 0;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top