题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main() {
string str;
cin>>str;
set<char> set;
string S = "";
int index = 0;
for (char ch : str){
if (set.find(ch) != set.end())
continue;
S += ch;
set.insert(ch);
}
for (char a = 'a'; a <= 'z'; a++){
if (set.find(a) != set.end())
continue;
S += a;
}
string word;
cin>>word;
string result = "";
for (auto ch : word){
result += S[ch - 'a'];
}
cout<<result;
}
// 64 位输出请用 printf("%lld")
顺丰集团工作强度 382人发布