HDUOJ-------The Hardest Problem Ever
The Hardest Problem Ever
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 13035 Accepted Submission(s): 5905
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".
DANGER KNOWS FULL WELL THAT CAESAR IS MORE DANGEROUS THAN HE
- #include<iostream>
- #include<cstring>
- #include<cstdlib>
- char str[]="VWXYZABCDEFGHIJKLMNOPQRSTU";
- char a[];
- int main()
- {
- int i;
- // freopen("test.in","r",stdin);
- // freopen("test.out","w",stdout);
- while(scanf("%[^\n]",a)!=EOF)
- {
- if(strcmp("ENDOFINPUT",a)==)
- break;
- if(strcmp("START",a)!=&&strcmp("END",a)!=)
- {
- for(i=;i<strlen(a);i++)
- {
- if(a[i]>='A'&&a[i]<='Z')
- printf("%c",str[a[i]-'A']);
- else
- printf("%c",a[i]);
- }
- puts("");
- }
- a[]=;
- getchar();
- }
- return ;
- }
HDUOJ-------The Hardest Problem Ever的更多相关文章
- HDU1048The Hardest Problem Ever
The Hardest Problem Ever Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & ...
- The Hardest Problem Ever(字符串)
The Hardest Problem Ever Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24039 Accept ...
- (字符串 枚举)The Hardest Problem Ever hdu1048
The Hardest Problem Ever 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1048 Time Limit: 2000/1000 MS ...
- hdu_1048_The Hardest Problem Ever_201311052052
The Hardest Problem Ever Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- HDOJ 1048 The Hardest Problem Ever(加密解密类)
Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caes ...
- C - The Hardest Problem Ever
Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever ...
- POJ 1298 The Hardest Problem Ever【字符串】
Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was ke ...
- Poj1298_The Hardest Problem Ever(水题)
一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar eve ...
- poj1298 The Hardest Problem Ever 简单题
链接:http://poj.org/problem?id=1298&lang=default&change=true 简单的入门题目也有这么强悍的技巧啊!! 书上面的代码: 很厉害有没 ...
随机推荐
- ORACLE中union/union all/Intersect/Minus用法
Union,对两个结果集进行并集操作,不包括重复行,同时进行默认规则的排序: Union All,对两个结果集进行并集操作,包括重复行,不进行排序: Intersect,对两个结果集进行交集操作,不包 ...
- 建模角度理解word embedding及tensorflow实现
http://www.jianshu.com/p/d44ce1e3ec2f 1. 前言 本篇主要介绍关键词的向量表示,也就是大家熟悉的word embedding.自Google 2013 年开源wo ...
- Shader开发工具: PVRShaman
1. A PVRShaman (.POD) workspace is provided as an example in the Chapter_10/PVR_LinearFog folder tha ...
- Wifidog初分析
一.综述 wifidog是搭建无线热点认证系统的解决方案之一,他比nocat.nodog更适合互联网营销思路.常见的使用在openwrt系统上,它实现了路由器和认证服务器的数据交互,在路由器方(客户端 ...
- chrome插件编写基本入门
chrome插件编写基本入门 http://igeekbar.com/igeekbar/post/331.htm #精选JAVASCRIPTCHROME 作为一名程序猿,怎么能不会写chrome插件 ...
- Log4j中conversionPattern的含义
%a -- 表示礼拜几,英文缩写形式,比如“Fri”%A -- 表示礼拜几,比如“Friday”%b -- 表示几月份,英文缩写形式,比如“Oct”%B -- 表示几月份,“October”%c -- ...
- C#.NET常见问题(FAQ)-如何让控件或者窗体本身全屏
初始化的时候保存控件的原始尺寸,然后通过Dock属性调节 注意如果你的控件是放在容器中的,那么对应设置的也要是容器的Dock属性 全屏的效果如下图所示 更多教学视频和资料下载,欢迎关注以下 ...
- 解决IE兼容模式的方案
在html头 加标签 强制使用最新的ie渲染 <meta http-equiv="X-UA-Compatible" content="IE=edge"&g ...
- jQuery.cookie应用操作
//1.插件框架: /* * name @键 * value @值 * options @选项,包括有效期 路径 域名等 */ jQuery.cookie = function(name, value ...
- 牛客网-《剑指offer》-重建二叉树
题目:http://www.nowcoder.com/practice/8a19cbe657394eeaac2f6ea9b0f6fcf6 C++ /** * Definition for binary ...