Run ID:118422

提交时间:2025-04-30 20:37:58

#include <iostream> #include <string> using namespace std; int main() { /*cdd abbccdd 是你需要替换的字符串,就是你要去操作的一个字符串 cdbaefghijklmnopqrstuvwxyz 替换的规则 abcdefghijklnmopqrstuvwxyz 第三行的字母去用第二行的字母进行替换 a[0] -> 'a' -> 'c' 'a' -> 'c' 映射关系 'a' 标号 0 -> 数组的下标 a[0] = 'c' if(s[i] == 'a') s[i] -> a[0]*/ string s1, s2; cin >> s1 >> s2; for(int i = 0; i < s1.size(); ++i) { s1[i] = s2[s1[i] - 'a']; } cout << s1 << endl; return 0; }