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. EF MySQL 提示 Specified key was too long; max key length is 767 bytes错误

    在用EF的CodeFirst操作MySql时,提示 Specified key was too long; max key length is 767 bytes错误,但数据库和表也建成功了.有高人知 ...

  2. BAK文件怎么恢复到数据库中

    1.右击SQLServer2000实例下的“数据库”文件夹.就是master等数据库上一级的那个图标.选择“所有任务”,“还原数据库” 2.在“还原为数据库”中填上你希望恢复的数据库名字.这个名字应该 ...

  3. Oracle创建数据库、表、用户

    create tablespace south_knowledge logging datafile 'D:\TestDatabase\south_knowledge.dbf' size 10m au ...

  4. java中的xpath,读取xml文档。

    1,入门 XPath即为XML路径语言(XML Path Language),它是一种用来确定XML文档中某部分位置的语言. XPath基于XML的树状结构,提供在数据结构树中找寻节点的能力.起初 X ...

  5. AngularJS心得体会

    AngularJS早些时候有过了解,知道这是一个JS的MVC框架,同类型的框架还有Backbone等.这次是由于项目需要,学习了两天的Angular后开始着手改之前的项目代码,这里大概说一下这一周学习 ...

  6. SharePoint 2013 实战碎嘴(ECMAScript客户端对象模型): 提示某个列表不存在

    简单情景描述1:(在Sharepoint 2013 Solution 中) 在相应的.aspx页面引入 一下两个.js文件: <script type="text/javascript ...

  7. 前端利器,如何使用fiddle拦截在线css进行先下调试

    fiddle的功能相当的强悍,用户也非常广,不过今天我就教大家用fiddle进行前端调试. 首先下载软件fiddle,点击对应的版本下载安装. 安装成功后打开看到右侧的导航栏: 点击AutoRespo ...

  8. ecshop简单结构

    Ecshop包括的文件夹有admin.api.cert.data.images.includes.js. languages.plugins.temp.theme.wap.widget这些文件夹,和根 ...

  9. 类型 - PHP手册笔记

    类型简介 PHP 支持 8 种原始数据类型. 四种标量类型: boolean(布尔型,不区分大小写) integer(整型) float(浮点型,也称作double) string(字符串) 两种复合 ...

  10. C#实现网页表单自动提交

    首先,设计一个简单的Form界面,好直观的查看登录情况,界面如图下图所示: 然后在 webBrowser1_DocumentCompleted函数中添加如下代码: private void webBr ...