首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >字符加密

字符加密

作者头像
WindCoder
发布2018-09-20 15:48:02
2860
发布2018-09-20 15:48:02
举报
文章被收录于专栏:WindCoderWindCoder

/* 功能:字符加密 日期:2013-04-01 */ #include<stdio.h> #include<stdlib.h> #include<math.h>

int main(void) { char One,Two,Three,Four,Five; printf("请输入5个字符:"); scanf("%c%c%c%c%c",&One,&Two,&Three,&Four,&Five);

if (One>=97&&One<=122)//第一个字符 { One=( One + 4 - 97 ) % 26 + 'a';

} if(One>=65&&One<=90) { One=( One + 4 - 65 ) % 26 + 'A'; } if (Two>=97&&Two<=122)//第二个字符 { Two=(Two + 4 - 97 ) % 26+'a'; } if (Two>=65&&Two<=90) { Two=(Two + 4 -65 ) % 26 + 'A'; } if (Three>=97&&Three<=122)//第三个字符 { Three=( Three + 4 - 97 ) % 26 + 'a'; } if (Three>=65&&Three<=90) { Three=(Three + 4 - 65 ) % 26 + 'A'; } if (Four>=97&&Four<=122)//第四个字符 { Four=( Four + 4 - 97 ) % 26 + 'a'; } if ( Four>=65&&Four<=90) { Four=(Four + 4 - 65 ) % 26 + 'A'; } if ( Five>=97&&Five<=122)//第五个字符 { Five=( Five + 4 - 97 ) % 26 + 'a'; } if (Five>=65&&Five<=90) { Five=( Five + 4 - 65 ) % 26 + 'A'; } printf("加密后的数值是:%c%c%c%c%cn",One,Two,Three,Four,Five); system("pause");

return 0; }

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2013-09-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档