题解 | 字符串加密
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
map<char, bool> ma;
string res;
for (auto x: s)
if (!ma[x]) {
ma[x] = true;
res += x;
}
for (int i = 0; i < 26; i++) if (!ma[i + 'a']) res += i + 'a';
for (auto x: t) cout << res[x - 'a'];
}