题解 | #简单密码#

简单密码

http://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac

#include<string>

using namespace std;

int main(){
    string a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; //非必要的参照字典
    string b = "bcdefghijklmnopqrstuvwxyza222333444555666777788899990123456789"; //字符输出对应字
    string rawstr;
    cin >> rawstr;
    for (int i = 0; i < rawstr.size(); i++){
        rawstr[i] = b[a.find(rawstr[i])];
    }
    cout << rawstr;
}               

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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