#include<bits/stdc++.h> using namespace std; int pos; int main(){ string s,a,t; getline(cin,s); getline(cin,a); getline(cin,t); int len=a.length(); while(s.find(a,pos)!=-1){ pos=s.find(a,pos); s.replace(pos,len,t); pos+=t.size(); } cout<<s; return 0; }
使用您的 Hydro 通用账户