HDU1048The Hardest Problem Ever
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
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.
Input
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".
Output
Sample Input
Sample Output
#include<bits/stdc++.h>
using namespace std;
int main() {
char s[],s1[],s2[];
while(gets(s1)&&strcmp(s1,"START")==) {
gets(s);
int len=strlen(s);
for(int i=; i<len; i++) {
if(isupper(s[i]))
s[i]=(s[i]-'A'+)%+'A';
}
while(gets(s2)&&strcmp(s2,"END")==) {
puts(s);
break;
}
}
return ;
}
HDU1048The Hardest Problem Ever的更多相关文章
- 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 ...
- HDUOJ-------The Hardest Problem Ever
The Hardest Problem Ever Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- 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 简单的入门题目也有这么强悍的技巧啊!! 书上面的代码: 很厉害有没 ...
随机推荐
- C++ 里 构建动态二维数组
//****动态二维数组 /* int m=3; int **data; int n=2; data=new int*[m]; for(int j=0;j<m;j++) { data[j]=ne ...
- Delphi XE5 for android 调用Java类库必看的文件
C:\Program Files\Embarcadero\RAD Studio\12.0\source\rtl\android 的目录 Androidapi.AppGlue.pasAndroidapi ...
- 自适应游标共享技术02(一个简单的例子来走近ACS)
为了不让其他因素干扰实验,参数设置如下: optimizer_mode=ALL_ROWS(使用CBO) optimizer_features_enable=11.2.0.3(使用最新的优化参数) op ...
- 不复杂的Autofac注入
private static void SetAutofacWebAPI() { var builder = new ContainerBuilder(); #region 配置注册方法 string ...
- IOS开发之后台处理
1 前言IOS4 之后提供了后台处理,在后台运行应用程序,在一些情形下甚至可以在用户按下Home按钮之后在后台运行. 2 详述IOS可以在用户按下Home按钮后将应用程序添加到暂停状态.这种暂停执行的 ...
- python爬取糗百第一页的笑话
自学python网络爬虫,发现request比urllib还是要好用一些,因此利用request和BeautifulSoup来实现糗百的首页笑话的抓取.BeautifulSoup通过find和find ...
- C#中Image , Bitmap 和 BitmapData
先说Image,Image 就是个图像,不能实例化,提供了位图和源文件操作的函数.本篇文章他就是来打酱油的,这里提供一个Bitmap转成BitmapSource的方法. [DllImport(&quo ...
- C 封装一个简单二叉树基库
引文 今天分享一个喜欢佩服的伟人,应该算人类文明极大突破者.收藏过一张纸币类型如下 那我们继续科普一段关于他的简介 '高斯有些孤傲,但令人惊奇的是,他春风得意地度过了中产阶级的一生,而 没有遭受到冷 ...
- ORA-14099 错误解决
DB: 11.2.0.3.0 在测试把普通表修改为交换分区的时候,出现ORA-14099: all rows in table do not qualify for specified partiti ...
- oracle 临时表空间
环境: OS: Oracle Linux Server release 5.7 DB: Oracle Database 11g Enterprise Edition Release 11.2.0.3. ...