#include <stdio.h>
int main()
{
// 凯撒加密,明文中字母按字母表左移或者右移三位,这里右移
char input[6] = "hello";
char output[6];
int key = 3;
int i,j;
for (i = 0; i < 5; i++)
{
int a = input[i];
a += 3;
output[i] = (char)a;
}
output[i] = '\0';
printf("加密后:%s\n", output);
for (j = 0; j < 5; j++)
{
int b = output[j];
b -= 3;
input[j] = (char)b;
}
input[j] = '\0';
printf("解密后:%s", input);
return 0;
}
当前位置:网站首页>凯撒密码实现
凯撒密码实现
2020-11-07 20:19:00 【PamShao】
版权声明
本文为[PamShao]所创,转载请带上原文链接,感谢
https://www.cnblogs.com/pam-sh/p/13941980.html
边栏推荐
猜你喜欢

Solution to st link USB communication error in stlink Download

不要把异常当做业务逻辑,这性能可能你无法承受

滴滴的分布式ID生成器(Tinyid),好用的一批

Advanced concurrent programming series 9 (lock interface analysis)

30岁后,你还剩下什么?

Web API系列(三)统一异常处理

Jenkins pipline stage setting timeout

频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?

If you want to forget the WiFi network you used to connect to your Mac, try this!

课堂练习
随机推荐
Code Review最佳实践
Microservice - how to limit and fuse service current
Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。
Exclusive interview with alicloud database of | 2020 PostgreSQL Asia Conference: Wang Xu
使用 Xunit.DependencyInjection 改造测试项目
是时候结束 BERTology了
pc端与移动端适配解决方案之rem
如何高效的学习技术
In simple terms, the large front-end framework angular6 practical course (angular6 node.js 、keystonejs、
廬山真面目之二微服務架構NGINX版本實現
Mate 40系列发布 搭载华为运动健康服务带来健康数字生活
课堂练习
Kylin on Kubernetes 在 eBay 的实践
C語言重點——指標篇(一文讓你完全搞懂指標)| 從記憶體理解指標 | 指標完全解析
从技术谈到管理,把系统优化的技术用到企业管理
三步一坑五步一雷,高速成长下的技术团队怎么带?
Implementation of nginx version of microservice architecture
2020-11-06: go, let's talk about the scheduler.
RECH8.0版本学习 days 12 rh134部分
AC86U kx上网