IBM Minus One

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

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
 #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int i,N;
//freopen("in.txt","r",stdin);
cin>>N;
getchar();
for(i=;i<=N;i++)
{
char a[];
int len,j;
gets(a);
len=strlen(a);
for(j=;j<len;j++)
{
if(a[j]=='Z')
a[j]='A';
else
a[j]++;
}
cout<<"String #"<<i<<endl<<a<<endl<<endl;
}
}
 

IBM Minus One(water)的更多相关文章

  1. HDU 1328 IBM Minus One

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

  2. IBM Minus One

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

  3. IBM Minus One 简单字符处理

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

  4. 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 ...

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

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

  6. ZOJ Problem Set - 1240 IBM Minus One

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

  7. 杭电ACM分类

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

  8. POJ题目细究

    acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  102 ...

  9. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

随机推荐

  1. ActionSupport.getText()方法 以及 js中:<s:text name="" />

    下面略述com.opensymphony.xwork2.ActionSupport.getText()方法 public String getText(String aTextName) 说明:Get ...

  2. 有关PHP中点击下载文件的小功能

    最近需要在项目里加一个可以点击导出树状目录的目录结构图, 我在网上查了之后,发现基本千篇一律, 都是使用下面这种header函数, 直接去readfile() 这个文件 header('Content ...

  3. linux创建SVN客户端,服务器

    1- linux基本都自带svn 2-创建svn服务器 新创建服务器代码仓库 # svnadmin create serversvn 这样,我们就在~/目录下新建了版本库serverSvn. 3-修改 ...

  4. css制作最简单导航栏

    css制作最简单导航栏

  5. mysql----show slave status \G 说明

    show slave status \G 可以用来查看mysql 的复制状态,有些列名所表达的意思不太明确,现整理如下: 1. Slave_IO_State:ID线程的状态,如果master 的所有变 ...

  6. python学习资料

    http://woodpecker.org.cn/diveintopython/ http://www.cnblogs.com/txw1958/archive/2012/12/10/A_Byte_of ...

  7. Blog透视镜

    Blog透视镜,提供了Blog代码示例,文章和教程,可以帮助你建置博客. 网站名称:Blog透视镜 网站地址:http://blog.openyu.org

  8. javascript之window对象

    window :window对象是BOM中所有对象的核心,除了是BOM中所有对象的父对象外,还包含一些窗口控制函数. 1.全局的window对象 JavaScript中的任何一个全局函数或变量都是wi ...

  9. [置顶] SPL讲解(4)--Criteria操作篇

    概念 以前一篇文章中,描述了实体Entity的操作,很明显,仅仅实体的操作是远远不够的.如:我们经常会根据查询条件从数据库中获取记录集并绑定到DataGrid上,会根据条件进行批量的Update和De ...

  10. css案例学习之ul li dl dt dd实现二级菜单

    效果 代码实现 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www ...