?? hill解密算法.cpp
字號:
#include<iostream>
#include<cstring>
using namespace std;
void main()
{
cout<<"input miyao:"<<endl;
int a[4];
for(int l=0;l<4;l++)
{
cin>>a[l];
}
cout<<"input miwen:"<<endl;
char b[100];
cin>>b;
int c[100];
int d[100];
for(int i=0;i<100;i++)
{
c[i]=b[i]-97;
}
for(int j=0;j<50;j++)
{
d[2*j]=(a[0]*c[2*j]+a[1]*c[2*j+1])%26;
d[2*j+1]=(a[2]*c[2*j]+a[3]*c[2*j+1])%26;
}
for(int n=0;n<100;n++)
{
b[n]=d[n]+97;
}
cout<<"mingwen:"<<endl;
cout<<b<<endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -