hd acm1048
You are a sub captain of Caesar's army. It is your job to decipher the messages sent by Caesar and provide to your general. The code is simple. For each letter in a plaintext message, you shift it five places to the right to create the secure message (i.e., if the letter is 'A', the cipher text would be 'F'). Since you are creating plain text out of Caesar's messages, you will do the opposite:
Cipher text
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Plain text
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
Only letters are shifted in this cipher. Any non-alphabetical character should remain the same, and all alphabetical characters will be upper case.
A single data set has 3 components:
Start line - A single line, "START"
Cipher message - A single line containing from one to two hundred characters, inclusive, comprising a single message from Caesar
End line - A single line, "END"
Following the final data set will be a single line, "ENDOFINPUT".
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main()
{
char cipher[3][200]; //用来存储每一个数据集
int j,k;
while(1)
{
for(j=0;j<3;j++)
{
gets(cipher[j]); //将每行的信息读入到数组中
if(j==1)
{
k=0;
while(cipher[1][k]!='\0') //破译密文
{
if(cipher[1][k]<'F'&&isupper(cipher[1][k]))
cipher[1][k]+=21;
else if(isupper(cipher[1][k]))
cipher[1][k]-=5;
k++;
}
}
}
if(strcmp(cipher[0],"ENDOFINPUT")!=0) puts(cipher[1]); //输出结果
if(strcmp(cipher[0],"ENDOFINPUT")==0) break; //输入结束的标志
}
return 0;
}
hd acm1048的更多相关文章
- ATI Radeon HD 5450 with full QE/CI Support ( 转载 )
ATI Radeon HD 5450 with full QE/CI Support - DSDT (Contains HDMI Audio Edit Too) & AGPM included ...
- XPS 15 9530使用Windows10频繁发生Intel HD Graphics 4600驱动奔溃的一种解决方法
本人使用XPS 15 9530.集成显卡为Intel HD Graphics 4600.操作系统Windows 10 Pro,使用过程当中经常会发生集成显卡奔溃的问题,错误提示如下: Display ...
- Radeon HD 7850 vs Radeon R9 270X
Radeon HD 7850 vs Radeon R9 270X HW compare Intro The Radeon HD 7850 comes with a GPU core speed ...
- 电影TS、TC、SCR、R5、BD、HD等版本是什么意思
在很多电影下载网站的影片标题中我们都能看到,比如<刺杀希特勒BD版>.<游龙戏凤TS版>等,这些英文缩写都是什么意思呢?都代表什么画质?以下就是各个版本的具体含义: 1.CAM ...
- stm32类型cl、vl、xl、ld、md、hd的含义
- startup_stm32f10x_ld_vl.s: for STM32 Low density Value line devices - startup_stm32f10x_ld.s: for ...
- 瑞昱Realtek(Realtek HD Audio Driver)音频声卡驱动R2.49 for Win7_Vista
不管是在高端系列主板上,还是在低端系列主板上,我们都能看到Realtek瑞昱的身影,Realtek HD Audio Driver能够支持所有的Realtek HD Audio音频驱动.Realtek ...
- cocos2d-x 2.0.3 设置高清模式注意事项(已移除-hd方式)
猴子原创,欢迎转载.转载请注明: 转载自Cocos2D开发网–Cocos2Dev.com,谢谢! 原文地址: http://www.cocos2dev.com/?p=304 在cocos2d-x 2. ...
- %hd %d %ld %u ......
%d 有符号10进制整数 %ld 长整型 %hd短整型%md,m指定的是输出字段的宽度,默认左补空格, 如果数据的位数小于m,则左端补以空格,若大于m,则 按实际位数输出,如: printf(&quo ...
- 求刷Kindle Fire HD的方法
前几天入手了台Amazon Kindle Fire HD 其系统是经过Amazon尝试改造过的Android,用起来很不爽,想刷个CM10之类的,求教程和工具.
随机推荐
- VBA小功能集合-判断列内是否有重复值
1.判断列内是否有重复值: Dim arrT As Range Dim rng As Range Set arrT = Range("A:A")'判读A列单元格 For Each ...
- 解决长时间计划任务rsync同步进程数过多
用rsync同步远程服务器,由于设置的的同步间隔较短(5分钟),这样一旦网速问题导致5分钟内同步不完.就会倒是同步紊乱,导致系统中很多rsync进程(# ps -aux | grep rsync) ...
- ps选框工具全解
我们每次选择工具的时候,ps上面都会变成特定的选项,比如说下面这些: 比如说选区工具的话就分为新选区.添加选区.交叉选区之类的,这些都是需要在实战中练习的. 不单单是选区有这个工具,其他的也有这个功能 ...
- Mysql-Proxy实现mysql读写分离、负载均衡 (转)
在mysql中实现读写分离.负载均衡,用Mysql-Proxy是很容易的事,不过大型处理对于性能方面还有待提高,主要配置步骤如下: 1.1. mysql-proxy安装 MySQL Proxy就是这么 ...
- k8s部署dns
硬件环境: 两台虚拟机, 10.10.20.203 部署docker.etcd.flannel.kube-apiserver.kube-controller-manager.kube-schedule ...
- 从零开始搭建android框架系列(转)
网址:从零开始搭建android框架系列 githup:https://github.com/CameloeAnthony/Ant
- Spring Cloud 微服务三: API网关Spring cloud gateway
前言:前面介绍了一款API网关组件zuul,不过发现spring cloud自己开发了一个新网关gateway,貌似要取代zuul,spring官网上也已经没有zuul的组件了(虽然在仓库中可以更新到 ...
- requestFullscreen实现全屏展示
requestFullscreen实现全屏展示. var fullContainer = document.getElementById('fullScreenContainer'); //先把元素展 ...
- 网页上10秒倒计时,完了后就自动跳转到另一个网页上html代码
用html代码的话就这样: <meta http-equiv="Refresh" content="10;URL=http://www.baidu.com" ...
- Android之——清理手机SD卡缓存
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/47375595 眼下,市场上非常多Android手机软件都具有清理SD卡缓存的功能, ...