题解 | 牛牛的替换
牛牛的替换
https://www.nowcoder.com/practice/f2a107dbb99243798d3048a672e8f747
#include <iostream>
using namespace std;
#include <string>
int main() {
int a;
cin>>a;
char q1,q2,q3,q4;
cin>>q1>>q2>>q3>>q4;
string s;
cin>>s;
for(char &c:s){
if(c==q1)c=q2;
if(c==q3)c=q4;
cout<<c;
}
return 0;
}
// 64 位输出请用 printf("%lld")

查看3道真题和解析