题解 | #字符串加解密#
字符串加解密
https://www.nowcoder.com/practice/2aa32b378a024755a3f251e75cbf233a
#include <iostream> using namespace std; int main() { string raw("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); string pw("bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA1234567890"); string strone; string strtwo; while(cin >> strone >> strtwo) { for(int i = 0; i < strone.size(); i++) { strone[i] = pw[raw.find_first_of(strone[i])]; } for(int j =0; j< strtwo.size(); j++) { strtwo[j] = raw[pw.find_first_of(strtwo[j])]; } cout << strone << endl <<strtwo << endl; } } // 64 位输出请用 printf("%lld")