#include <iostream>
#include <string>
using namespace std;
int main() {
string str1, str2;
cin >> str1;
cin >> str2;
string res = "abcdefghijklmnopqrstuvwxyz";
//去掉str1中的重复字符
int i = 0;
string temp = "";
for(i = 0; i < str1.size(); ++i){
if (temp.find(str1[i]) != str1.npos) {
continue;
}
temp.push_back(str1[i]);
}
//去掉res中的temp
for(i = 0; i < temp.size();){
if (res.find(temp[i]) != res.npos) {
int pos = res.find(temp[i]);
res = res.substr(0, pos) + res.substr(pos+1);
}
else{
++i;
}
}
res = temp + res;
for(i = 0; i < str2.size(); ++i){
cout << res[str2[i] - 'a'];
}
}
// 64 位输出请用 printf("%lld")
HJ36 字符串加密
最新推荐文章于 2024-11-11 17:18:59 发布