Untitled

 avatar
unknown
c_cpp
2 years ago
481 B
5
Indexable
#include <bits/stdc++.h>
#define ll long long
using namespace std;

string s, c1, c2;
int m;
int main()
{
   //freopen("test.INP", "r", stdin); freopen("test.OUT", "w", stdout);
   ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

   cin >> s;
   cin >> m;
   while(m--){
        int a, b; cin >> a >> b >> c1 >> c2;
        for(int i=a; i<=b; i++)
        {
            if(s[i] == c1[0]) s.replace(i, 1, c2);
        }
   }
   cout << s;
}




Editor is loading...