IBM Minus One

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4462    Accepted Submission(s): 2337

Problem Description

You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or the film of the same name by Stanley Kubrick. In it a spaceship is sent from Earth to Saturn. The crew is put into stasis for the long flight, only two men are awake, and the ship is controlled by the intelligent computer HAL. But during the flight HAL is acting more and more strangely, and even starts to kill the crew on board. We don't tell you how the story ends, in case you want to read the book for yourself :-)

After the movie was released and became very popular, there was some discussion as to what the name 'HAL' actually meant. Some thought that it might be an abbreviation for 'Heuristic ALgorithm'. But the most popular explanation is the following: if you replace every letter in the word HAL by its successor in the alphabet, you get ... IBM.

Perhaps there are even more acronyms related in this strange way! You are to write a program that may help to find this out.

 

Input

The input starts with the integer n on a line by itself - this is the number of strings to follow. The following n lines each contain one string of at most 50 upper-case letters.
 
Output
For each string in the input, first output the number of the string, as shown in the sample output. The print the string start is derived from the input string by replacing every time by the following letter in the alphabet, and replacing 'Z' by 'A'.

Print a blank line after each test case.

 
Sample Input
2
HAL
SWERC
 

Sample Output

String #1
IBM

String #2
TXFSD

 

Source

 
#include<iostream>
#include<string>
using namespace std; int main(void)
{
int n,j=;
string str; cin>>n;
while(n--)
{
cin>>str;
for(int i=;i<str.size();i++)
{
if(str[i]=='Z')
str[i] = 'A'; //注意一下就行
else
str[i] = str[i]+;
}
cout<<"String #"<<j<<endl<<str<<endl<<endl;
j++;
} return ;
}

HDU 1328 IBM Minus One的更多相关文章

  1. HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)

    Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...

  2. IBM Minus One(water)

    IBM Minus One Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  3. IBM Minus One

    IBM Minus One Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total ...

  4. IBM Minus One 简单字符处理

    IBM Minus One Time Limit: 2 Seconds      Memory Limit: 65536 KB You may have heard of the book '2001 ...

  5. ZOJ 1240 IBM Minus One

    /* You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or the film of the s ...

  6. ZOJ Problem Set - 1240 IBM Minus One

    水题不解释,就是注意下格式,没输出一行字符串记得加一个空白行 #include <stdio.h> #include <string.h> int main() { ; ]; ...

  7. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

  8. HDU ACM-Steps

    HDU ACM-Steps RECORD Chapter 1 Section 1 暖手题 1.1.1 A+B for Input-Output Practice (I) #include <st ...

  9. 杭电ACM分类

    杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...

随机推荐

  1. Andriod定时任务

    参考地址:http://blog.sina.com.cn/s/blog_73288dd10101m6xs.html,http://blog.csdn.net/fancsxx/article/detai ...

  2. 【JSONKit】序列化Dictionary崩溃

    jsonkit通过Dictionary转换成JSON字符串时总是崩溃. 解析代码: 崩溃地点 分析是因为我的参数中全是数字   找了一下原因,不知道知道怎么设置,(求大神指点) 这里有一个折中办法使用 ...

  3. 关于JS变量和作用域

    ECMAScript 变量:1.基本类型值(简单数据段) 2.引用类型值(可能由过个值构成的对象) → 保存在内存中的对象 动态属性: 只能给引用型值动态添加新属性,以便将来使用. 复制变量值 : 基 ...

  4. hadoop源码编译

    为何要自行编译hadoop源码,往往是由于官方提供的hadoop发行版都是基于32位操作系统,在操作hadoop时会发生warn.   准备软件: 1)JDK 2)Hadoop源码 3)Maven 4 ...

  5. 屏蔽鼠标右键功能JS

    <script language="Javascript">     function hiderightKey(){    return false; } docum ...

  6. Spring的IOC注解学习

    先引入jar包,common-annotations.jar 接着上代码: 1.dao接口 package com.dao; public interface OkpDao { public void ...

  7. MySQL计数器表的设计

    如果应用在表中保存计数器,则在更新计数器时可能碰到并发问题.计数器表在web应用中非常常见.可以用这个表缓存一个用户的朋友书.文件下载次数等.创建一张独立的表存储计数器是一种非常好的做法,这样可以使计 ...

  8. [汇编语言]-第七章 用[bx+idata]的方式进行数组的处理

    1- 转化为大写 方法一: assume cs:code,ds:data data segment db 'BaSiC' db 'MinIX' data ends code segment start ...

  9. 自动生成XML空节点格式的差异

    我们用C#开发了上位机配置软件,用C开发了嵌入式软件,然后他们之间的参数交互靠XML文件来沟通. C#中添加一个空的节点有以下几种情况. 不给节点的InnerText赋值: <root> ...

  10. VS2010 发布网站时如何使DLL文件名固定

    VS在发布网站时,bin目录里为所有cs生成的dll文件每次都是随机命名的,如:App_Web_xxxxxxxx.dll(xxxxxxx是8个小写的字母和数字组成的字符串,随机的),这样对更新 Liv ...