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. openssl 第一篇

    自从老罗赞助了openssl以及心脏出血事件的新闻,得以了解了openssl.那么什么是openssl呢?下面摘自官网: The OpenSSL Project is a collaborative  ...

  2. Logging in Java

    Common logging: Log4j1仅仅作为一个实际的日志框架,commons-logging作为门面,统一各种日志框架的混乱格局 基本的commons logging Dependency: ...

  3. C语言的本质(36)——makefile基础

    除了Hello World这种极简单的程序之外,一般的程序都是由多个源文件编译链接而成的,这些源文件的处理步骤通常用Makefile来管理.makefile带来的好处就是--"自动化编译&q ...

  4. C#中删除字符串最后一个字符的几种方法

    转载地址 偶然看到的,记录一下,以免忘记 字符串:string s = "1,2,3,4,5," 目标:删除最后一个 "," 方法:    1.用的最多的是Su ...

  5. Php开发官方IDE ZEND

    From http://www.zend.com/en/products/studio 注:唯一的缺点是收费.

  6. MySql 取一天的开始时间和结束时间

    -- 取一开的开始时间 SELECT str_to_date(DATE_FORMAT(NOW(),'%Y-%m-%d'),'%Y-%m-%d %H:%i:%s'); -- 取第二天的开始时间 sele ...

  7. 更新-----Scripts:执行双网卡绑定

    #!/bin/bash #------------------------------------------------------------------------------- # Name: ...

  8. Android应用程序窗口(Activity)实现框架简要介绍和学习计划

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/8170307 前面我们学习了SurfaceFli ...

  9. 分类: LINUX apache 访问设置配置

    分类: LINUX 在一次面试的时候被问到apache访问控制的问题.由于以前对apache的访问控制都是通过iptalbes来实现的,没有实际在apache上操作过访问控制.所以只知道个大概: 在主 ...

  10. H5 视频直播相关技术

    一.移动视频直播发展 大家首先来看下面这张图: 可以看到,直播从 PC 到一直发展到移动端,越来越多的直播类 App 上线,同时移动直播进入了前所未有的爆发阶段,但是对于大多数移动直播来说,还是要以 ...