题解 | #简单密码#

简单密码

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

利用string建立map对应,利用str.find()查找索引

#include<iostream>
#include<string>
using namespace std;

int main()
{
    string input,output;
    cin>>input;
    string a={"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"};
    string b={"bcdefghijklmnopqrstuvwxyza222333444555666777788899990123456789"};
    for(auto x:input)
    {
        string temp;
        temp=b[a.find(x)];
        cout<<temp;       
    }
}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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