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. Android 一次退出所有activity的方法

    转自:http://bbs.51cto.com/thread-970933-1.html 因为android的API中没有提供一次性退出的接口所以想要在多activity的程序里面一次性退出的话就要费 ...

  2. java使用注解和反射打造一个简单的jdbc工具类

    a simple jdbc tools 如有转载和引用,请注明出处,谢谢 1. 定义我们需要的注解 要想实现对数据库的操作,我们必须知道数据表名以及表中的字段名称以及类型,正如hibernate 使用 ...

  3. 查看Android数据库文件

    使用Eclipse DDMS的File Explorer不能能看到Data目录下面的东西,可能由下面原因引起的 手机没有Root  -- 可以使用Root大师 Data文件权限不够 -- 可以使用Ro ...

  4. Oracle中中文、数字,英文混杂形式的字段进行排序的方法

    http://blog.csdn.net/p451933505/article/details/9272257 对Oracle中中文.数字.英文混杂形式的字段进行排序的方法: 例如: order by ...

  5. sql 练习(1)

    1.建立实验表 CREATE TABLE STUDENT (SNO ) NOT NULL, SNAME ) NOT NULL, SSEX ) NOT NULL, SBIRTHDAY DATE, CLA ...

  6. Android 判断文件的类型

    import java.util.HashMap; import java.util.Iterator; /** * 判断文件的类型 */ public class MediaFileUtil { p ...

  7. TCP的拥塞控制(转载)

    1.引言 计算机网络中的带宽.交换结点中的缓存和处理机等,都是网络的资源.在某段时间,若对网络中某一资源的需求超过了该资源所能提供的可用部分,网络的性能就会变坏.这种情况就叫做拥塞. 拥塞控制就是防止 ...

  8. visual studio无法输入密匙解决方法

    控制面板->程序和功能->修复/卸载(更改),当到输入密匙界面运行程序,即可出现密匙输入框. 所用程序网上搜索:CrackVS2008ForWindows7

  9. [Oracle]查看和修改连接数

    #登陆数据库sqlplus system/*** as sysdba #显示当前最大连接数:show parameter processes; show parameter sessions; #修改 ...

  10. php讲中文json数据编码

    <?php function show_jsonmsg($data){ if(is_array($data)){ $return = $data; }else{ $return = array( ...