#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
边栏推荐
猜你喜欢
chrome浏览器跨域Cookie的SameSite问题导致访问iframe内嵌页面异常
快進來!花幾分鐘看一下 ReentrantReadWriteLock 的原理!
课堂练习
Vue: Axios uses this pointer
Mate 40 series launch with Huawei sports health service to bring healthy digital life
C语言I博客作业03
HMS core push service helps e-commerce app to carry out refined operation
bgfx编译教程
【笔记】Error while loading PyV8 binary: exit code 1解决方法
9.集群之间服务通信 RoutingMesh
随机推荐
Kubernetes服务类型浅析:从概念到实践
课堂练习
深入web workers (上)
一种超参数优化技术-Hyperopt
C語言重點——指標篇(一文讓你完全搞懂指標)| 從記憶體理解指標 | 指標完全解析
Code Review最佳实践
And how to solve the conflict between pop-up menu and pop-up menu
2020-11-06:go中,谈一下调度器。
Idea activation to 2089 failure
Rech8.0 learning days 12 rh134
C language I blog assignment 03
嘉宾介绍|2020 PostgreSQL亚洲大会中文分论坛:潘娟
Developing STM32 USB with cubemx
小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
RECH8.0版本学习 days 12 rh134部分
Web API series (3) unified exception handling
Talk about sharing before paying
9. Routingmesh service communication between clusters
HMS Core推送服务,助力电商App开展精细化运营
GrowingIO 响应式编程探索和实践