mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 13:58:48 +00:00
770. 单词替换
https://www.acwing.com/problem/content/submission/code_detail/6827022/
This commit is contained in:
parent
7321d1de16
commit
b6ee5f6b23
20
AcWing/770/770.cpp
Normal file
20
AcWing/770/770.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
string s, s1, s2;
|
||||
getline(cin, s);
|
||||
stringstream ss;
|
||||
ss << s;
|
||||
cin >> s1 >> s2;
|
||||
while (ss >> s) {
|
||||
if (s == s1) {
|
||||
cout << s2 << ' ';
|
||||
} else {
|
||||
cout << s << ' ';
|
||||
}
|
||||
}
|
||||
cout << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user