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 简单的入门题目也有这么强悍的技巧啊!! 书上面的代码: 很厉害有没 ...
 
随机推荐
- iOS开发-UIRefreshControl下拉刷新
			
下拉刷新一直都是第三库的天下,有的第三库甚至支持上下左右刷新,UIRefreshControl是iOS6之后支持的一个刷新控件,不过由于功能单一,样式不能自定义,因此不能满足大众的需求,用法比较简单在 ...
 - C#访问远程主机资源的方法
			
实现访问远程主机的共享目录中的一个文件的解决方法: 一.调用Net use命令 // 使用方法: //if (Connect("192.168.1.48", &quo ...
 - Centos curl ssl 替换 NSS 为 OpenSSL
			
参考:https://www.latoooo.com/xia_zhe_teng/368.htm 我的系统版本是 Centos 7 64位.为了方便,先安装常用的开发环境. yum groupinsta ...
 - 【Python】无须numpy,利用map函数与zip(*)函数对数组转置(转)
			
http://blog.csdn.net/yongh701/article/details/50283689 在Python的numpy中,对类似array=[[1,2,3],[4,5,6],[7,8 ...
 - WordPress 获取指定分类ID的分类信息
			
get_term:直接从数据库中获取分类信息get_the_category:使用post_id作为参数,先根据post_id查询对应的文章然后再返回对应的分类信息,如果没有文章信息则返回Null 之 ...
 - Linux中盘符的两种挂载方法
			
相信接触过Linux系统的人对于mount命令都不陌生,今天是农历2017年的最后一个工作日,趁着时光还在,就说一下两种不同的挂载方法吧. 课前小知识: 命令格式:mount [-t vfstype] ...
 - Solidworks公司电脑图纸被加密之后如何解密输出
			
第一步:打开总装配的组件(该组件需要包含你所有需要的零件),比如打开其中一个: 第二步:Solidworks的菜单中依次:"文件"→"打包"(有的版本是pa ...
 - Discuz常见小问题-如何批量加精,置顶帖子
			
批量选中帖子,然后置顶和精华都可以勾选 完成之后的效果
 - 1073: 动物简介(animal)
			
#include<iostream> #include<string> #include<stdio.h> #include<algorithm> #i ...
 - 详解JAVA输出Hello World
			
想必大家对这一段JAVA代码一定不会陌生: public class Test { public static void main(String[] args) { System.out.printl ...