#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
边栏推荐
- C語言重點——指標篇(一文讓你完全搞懂指標)| 從記憶體理解指標 | 指標完全解析
- 在pandas中使用pipe()提升代码可读性
- CI / CD of gitlab continuous integrated development environment
- Classroom exercises
- Solution to st link USB communication error in stlink Download
- Vscode configuration
- 聊一聊数据库中的锁
- 【笔记】Error while loading PyV8 binary: exit code 1解决方法
- 想要忘记以前连接到Mac的WiFi网络,试试这个方法!
- [random talk] the goal and way of software design
猜你喜欢
Solution to st link USB communication error in stlink Download
三步一坑五步一雷,高速成长下的技术团队怎么带?
课堂练习
How to solve the problem of blank page in Google Chrome browser
What should be considered in the promotion plan outside the station?
技术总监7年自述——如何选择一家好公司
vue踩坑:axios使用this指针
频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
git 提交规范
如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题
随机推荐
Using rabbitmq to implement distributed transaction
把 4个消息队列都拉到一个群里后,他们吵起来了
华为HCIA笔记
DOM节点操作
如何高效的学习技术
【QT】QThread原始碼淺析
Vscode configuration
Do you really know how to use search engines?
屏读时代,我们患上了注意力缺失候群症
k-vim安装及The ycmd server SHUT DOWN (restart with ':YcmRestartServer')这种错误的解决方法
Code Review最佳实践
留给快手的时间不多了
技术总监7年自述——如何选择一家好公司
C language I blog assignment 03
Microservice - how to limit and fuse service current
C language I blog assignment 03
Vue: Axios uses this pointer
三步一坑五步一雷,高速成长下的技术团队怎么带?
Key points of C language -- index article (let you fully understand indicators) | understand indicators from memory | complete analysis of indicators
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom