#include<iostream>
using namespace std;
#define N 1000
void decrypt(char x[N])
{
for(int i=1;i<=25;++i)
{
for(int j=0;;++j)
{
if(x[j]>96&&x[j]<123)
x[j]=(x[j]-1-122)%26+122;
else if(x[j]>64&&x[j]<91)
x[j]=(x[j]-1-90)%26+90;
else
x[j]=x[j];
if(x[j]==0) break;
}
cout<<"The result is:"<<x<<endl;
}
}
int main()
{
char x[N] = {0};
cout<<"Please enter the message:";
cin.getline(x,N);
decrypt(x);
return 0;
}
C/C++:移位密码穷举解密
最新推荐文章于 2021-05-23 08:16:45 发布