#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
边栏推荐
- 嘉宾专访|2020 PostgreSQL亚洲大会中文分论坛:岳彩波
- 课堂练习
- HMS core push service helps e-commerce app to carry out refined operation
- PHP security: the past and present of variables
- Classroom exercises
- 深入浅出大前端框架Angular6实战教程(Angular6、node.js、keystonejs、
- 使用“1”个参数调用“DownloadString”时发生异常:“操作超时”
- vue踩坑:axios使用this指针
- From technology to management, the technology of system optimization is applied to enterprise management
- 聊聊Go代码覆盖率技术与最佳实践
猜你喜欢

Come on in! Take a few minutes to see how reentrantreadwritelock works!

Vscode configuration

Let you have a deep understanding of gitlab CI / CD principle and process

Developing STM32 USB with cubemx

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

Knowledge competition of garbage classification

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

AC86U kx上网

gitlab 持续集成开发环境之CI/CD

Andque.
随机推荐
阿里terway源码分析
深入web workers (上)
If you want to forget the WiFi network you used to connect to your Mac, try this!
快進來!花幾分鐘看一下 ReentrantReadWriteLock 的原理!
Application and principle of handlermethodargumentresolver
In simple terms, the large front-end framework angular6 practical course (angular6 node.js 、keystonejs、
Andque.
HandlerMethodArgumentResolver使用和原理
Mate 40系列发布 搭载华为运动健康服务带来健康数字生活
嘉宾介绍|2020 PostgreSQL亚洲大会中文分论坛:潘娟
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
C language I blog assignment 03
使用“1”个参数调用“DownloadString”时发生异常:“操作超时”
Analysis of the original code of [QT] qthread
傲視Kubernetes(一):Kubernetes簡介
Knowledge competition of garbage classification
Why do we need software engineering -- looking at a simple project
Using thread communication to solve the problem of cache penetrating database avalanche
Vue: Axios uses this pointer
[original] the impact of arm platform memory and cache on the real-time performance of xenomai