题解 | 字符串操作
字符串操作
https://www.nowcoder.com/practice/06a5336b64e3481fbbcc1f7d5cba548d?tpId=383&tqId=142542&sourceUrl=%2Fexam%2Foj
#include <bits/stdc++.h>
using namespace std;
int main() {
int m,n;
string s;
cin>>m>>n>>s;
while(n--)
{
int a,b;
char d,e;
cin>>a>>b>>d>>e;
for(int i=a-1;i<b;i++)
{
if(s[i]==d)
s[i]=e;
}
}
for(char a:s)
cout<<a;
return 0;
}
