#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
边栏推荐
- Bgfx compilation tutorial
- Technical debt is a lack of real understanding of business functions- daverupert.com
- Developing STM32 USB with cubemx
- 留给快手的时间不多了
- C enumerates the differences between permissions |, and |
- 高级并发编程系列九(Lock接口分析)
- From technology to management, the technology of system optimization is applied to enterprise management
- 嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王旭
- 2020-11-06:go中,谈一下调度器。
- STlink下载出现st-link usb communication error解决方法
猜你喜欢

Talk about sharing before paying

Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。

使用“1”个参数调用“DownloadString”时发生异常:“操作超时”

Mac新手必备小技巧

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

The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.

Opencv computer vision learning (10) -- image transform (Fourier transform, high pass filter, low pass filter)

一次公交卡被“盜刷”事件帶來的思考

CPU瞒着内存竟干出这种事

vue踩坑:axios使用this指针
随机推荐
我是如何失去团队掌控的?
微服務 - 如何進行服務限流和熔斷
技术总监7年自述——如何选择一家好公司
K-vim installation and the ycmd server shut down (restart with ': ycmrestartserver')
[random talk] the goal and way of software design
HMS core push service helps e-commerce app to carry out refined operation
Kylin on Kubernetes 在 eBay 的实践
快進來!花幾分鐘看一下 ReentrantReadWriteLock 的原理!
[graffiti footprints of Internet of things] mainstream communication mode of Internet of things
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
三步一坑五步一雷,高速成长下的技术团队怎么带?
Awk implements SQL like join operation
【涂鸦物联网足迹】物联网主流通信方式
HMS Core推送服务,助力电商App开展精细化运营
屏读时代,我们患上了注意力缺失候群症
C语言I博客作业03
Solution to st link USB communication error in stlink Download
vscode 配置
11.Service更新
Git submission specification