C语言!凯撒算法(只加密)的源码源码h264 rtp 源码源代码
凯撒密码的原理是字母与字母之间的替换。例如个字母都向后移动K位。输入主机销售网站源码若K等于2,凯撒凯撒图片展示 asp 源码则A用C代替,密码密码asp 点餐系统源码B用D代替,源码源码以此类推。输入#include <stdio.h>#include <conio.h>
int main(){
int key;
char mingma,凯撒凯撒mima;
printf("\nPlease input the character:");
scanf("%c",&mingma); //输入明码
printf("\nPlease input the key:");
scanf("%d",&key); //输入秘钥
if((mingma>='A')&&(mingma<='Z'))
mima='A'+(mingma-'A'+key)%; //大写字母移位
else if((mingma>='a')&&(mingma<='z'))
mima='a'+(mingma-'a'+key)%; //小写字母移位
printf("\n The output is:%c",mima); //输出密码
printf("\nFinished!\n");
getch();
return 0;
}
2024-12-23 06:19
2024-12-23 06:09
2024-12-23 04:49
2024-12-23 04:39
2024-12-23 04:38