题解 | #字符串加解密#

字符串加解密

https://www.nowcoder.com/practice/2aa32b378a024755a3f251e75cbf233a

#include <iostream>
using namespace std;

int main() {
    string str1,str2;
    getline(cin,str1);
    getline(cin,str2);
    string str3 ={"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};
    string str4 ={"BCDEFGHIJKLMNOPQRSTUVWXYZAbcdefghijklmnopqrstuvwxyza1234567890"};

    for(int i =0; i<str1.length(); i++){
        str1[i] =str4[str3.find(str1[i])];
    }
    for(int i =0; i<str2.length(); i++){
        str2[i] =str3[str4.find(str2[i])];
    }
    cout << str1 << endl;
    cout << str2 << endl;
}

全部评论

相关推荐

05-10 16:48
门头沟学院 Java
程序员小白条:主要原因,投递太晚了,快手应该早点溜了,你都从去年9月开始的,半年也差不多3月跑路了,这样的话,至少有5个以上的面试机会
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务