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. css3的滤镜模糊的效果

    最近在做一个css3的滤镜模糊的效果,但是我发现,有些浏览器一点效果都没有,这是浏览器兼容性导致的,怕今后会忘记所以就先写下来,也希望可以帮到需要的小伙伴. 代码如下: div{//设置半透明滤镜效果 ...

  2. C# log Helper

    using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; usin ...

  3. C语言的本质(35)——共享库

    库用于将相似函数打包在一个单元中.然后这些单元就可为其他开发人员所共享,并因此有了模块化编程这种说法- 即,从模块中构建程序.Linux支持两种类型的库,每一种库都有各自的优缺点.静态库包含在编译时静 ...

  4. RTP 包格式 详细解析

    H.264 视频 RTP 负载格式 1. 网络抽象层单元类型 (NALU) NALU 头由一个字节组成, 它的语法如下: +---------------+      |0|1|2|3|4|5|6|7 ...

  5. Combination Sum II 解答

    Question Given a collection of candidate numbers (C) and a target number (T), find all unique combin ...

  6. Ajax下载文件(页面无刷新)

    说明:Ajax是无法实现文件传输的,本文只是模拟了Ajax不刷新页面就可以请求并返回数据的效果.实质上还是通过提交form表单来返回文件流的输出. 分步实现逻辑: ajax请求服务器,访问数据库,根据 ...

  7. IOS ViewController 生命周期

    加载过程 第一步 -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 第二步 -(void) ...

  8. java学习笔记day03

    1.二维数组,即一维护 int[][] arr1 = new int[3][2]; int[][] arr2 ={{2,4,3,6,22,7},{3,6,8,9},{10,13,24,5}}; pub ...

  9. 本地无sqlserver服务下操作数据库 之GSQL

    作为程序员无论是我们写的各种MIS系统还是游戏都离不开数据的存取操作,正如我们前几天在VS下做的一MIS系统,现在纠结. 如果是C/S或B/S模型就好了,可是需求不是,没办法,顾客是上帝...他们的需 ...

  10. 每日一发linux命令

    很多用虚拟机的同学在向/tmp目录下进行解压的时候,会发现之前挂载的此目录空间不足,导致下一步无法进行(我在vmwaretools解压的时候就遇到了这个problem)…… 实际上,/tmp是可以进行 ...