怎么没人发题解?
2025-04-30 18:49:04
发布于:四川
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
getline(cin, s);
string a, b;
cin >> a >> b;
s += ' ';
int en = s.find(" "), st = 0;
while(en != -1) {
string t = "";
for (int i = st; i < en; i++)
t += s[i];
if (t == a) cout << b << " ";
else cout << t << " ";
st = en + 1, en = s.find(" ", st);
}
return 0;
}
这里空空如也
有帮助,赞一个