解题思路:
注意事项:
参考代码:
#include <iostream> #include <sstream> // #include <cstdio> // #include <algorithm> // #include <cmath> // #include <cstdlib> #include <cstring> // #include <cctype> // #include <string> // #include <climits> // #include <map> #include <vector> // #include <list> // #include <set> using namespace std; // const int maxn = 40004; // const long long MOD = 100000007; // const double PI = acos(-1.0); int main() { // ios::sync_with_stdio(false); // cin.tie(0); string s, a, b; getline(cin, s); cin >> a >> b; vector<string> strs; stringstream ss(s); string tmp; while (ss >> tmp) strs.push_back(tmp); for (auto it : strs) { if (it == a) cout << b << " "; else cout << it << " "; } return 0; }
0.0分
2 人评分
C语言训练-数字母 (C语言代码)浏览:649 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:647 |
C语言程序设计教程(第三版)课后习题8.2 (C语言代码)浏览:5232 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:672 |
【计算球体积】 (C语言代码)浏览:1106 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:667 |
Tom数 (C语言代码)浏览:725 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:450 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:1245 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:1189 |