Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
81841 石晋骁 字符替换 C++ Accepted 1 MS 280 KB 266 2024-07-12 15:41:13

Tests(5/5):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char s[201]; char a,b; cin >> s; cin >> a >> b; for(int i = 0;i < strlen(s);i++){ if(s[i] == a){ s[i] = b; } } for(int j = 0;j < strlen(s);j++){ cout << s[j]; } return 0; }