代换加密

#include "stdafx.h"
#include "iostream"
using namespace std;
#include "string"

char a[26]={'d','l','r','y','v','o','h','e','z','x','w','p','t','b','g','f','j','q','n','m','u','s','k','a','c','i'};//代换表

void fuc(string s)
{
    for(int i=0;i<s.size();i++)
        s[i]=a[s[i]-65];
    cout<<s<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
    string s="MGZVYZLGHCMHJMYXSSFMNHAHYCDLMHA";
    fuc(s);
    return 0;
}

 

posted @ 2020-03-23 08:00  Butcher512  阅读(141)  评论(0)    收藏  举报