#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
边栏推荐
- 滴滴的分布式ID生成器(Tinyid),好用的一批
- The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
- Vue: Axios uses this pointer
- 工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
- Python3 operating gitlab
- PHP security: the past and present of variables
- Using thread communication to solve the problem of cache penetrating database avalanche
- HMS core push service helps e-commerce app to carry out refined operation
- Come on in! Take a few minutes to see how reentrantreadwritelock works!
- Developing STM32 USB with cubemx
猜你喜欢

Classroom exercises

The samesite problem of cross domain cookie of Chrome browser results in abnormal access to iframe embedded pages

Mac新手必备小技巧

awk实现类sql的join操作

站外推广的计划需要考虑哪些呢?

带你深入了解 GitLab CI/CD 原理及流程

嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王旭

What should be considered in the promotion plan outside the station?

我们为什么需要软件工程——从一个简单的项目进行观察

C enumerates the differences between permissions |, and |
随机推荐
Come on in! Take a few minutes to see how reentrantreadwritelock works!
If you want to forget the WiFi network you used to connect to your Mac, try this!
Solution to st link USB communication error in stlink Download
聊聊先享後付
CI / CD of gitlab continuous integrated development environment
Python3 operating gitlab
我是如何失去团队掌控的?
Using thread communication to solve the problem of cache penetrating database avalanche
课堂练习
使用 Xunit.DependencyInjection 改造测试项目
嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王旭
Exclusive interview with Yue Caibo
一次公交卡被“盜刷”事件帶來的思考
建议患者自杀,OpenAI警告:GPT-3用于医疗目的风险太高
当 TiDB 与 Flink 相结合:高效、易用的实时数仓
低代码 vs 模型驱动,它们之间到底是什么关系?
频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
滴滴的分布式ID生成器(Tinyid),好用的一批
【笔记】Error while loading PyV8 binary: exit code 1解决方法
Facebook开源框架如何简化 PyTorch 实验