From b6ee5f6b23edd327f4147b8baf4baf3d2a986df9 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sun, 1 Aug 2021 19:44:12 +0800 Subject: [PATCH] =?UTF-8?q?770.=20=E5=8D=95=E8=AF=8D=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/6827022/ --- AcWing/770/770.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 AcWing/770/770.cpp diff --git a/AcWing/770/770.cpp b/AcWing/770/770.cpp new file mode 100644 index 00000000..79adab34 --- /dev/null +++ b/AcWing/770/770.cpp @@ -0,0 +1,20 @@ +#include + +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; +}