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. 秒(s) 毫秒(ms) 微秒(μs) 纳秒(ns) 皮秒(ps)及Java获得 .

    Date date=new Date(); long hm=date.getTime(); //获取毫秒 或者 毫秒级:System.currentTimeMillis() 纳秒级: System.n ...

  2. 话说 MAX_FILE_SIZE

    PHP关于文件上传部分,特别提到表单隐藏域:MAX_FILE_SIZE,意思是接收文件的最大尺寸.文档中给出的例子如下: <form enctype="multipart/form-d ...

  3. python Post方式发起http请求 使用百度接口地理编码

    import os import httplib import json import urllib baiduapi="api.map.baidu.com:80" src=&qu ...

  4. php设置和获取变量类型

    1. 获取变量类型 gettype($a); 2. 设置变量类型 settype($a,'int'); 3. 测试函数 is_array();是否数组 is_string();是否字符串 is_obj ...

  5. js 实现二叉树

    二叉树是每个结点最多有两个子树的有序树.通常子树的根被称作“左子树”(left subtree)和“右子树”(right subtree),右边的总是大于左边的!二叉树的每个结点至多只有二棵子树(不存 ...

  6. Linux Ubuntu download

    下载地址:http://www.ubuntu.com/download/ Ubuntu桌面用户版 符合用户个性的版本

  7. 正则表达式、find、grep、awk、sed

    1.正则表达式    (1)正则表达式一般用来描述文本模式的特殊用法,由普通字符(例如字符a-z)以及特殊字符(称为元字符,如/.*.?等)组成.   (2)基本元字符集及其含义       ^ :只 ...

  8. Memcached安装,操作,用C#操作

    本文来自:http://li19910722.blog.163.com/blog/static/136856822201406103313163/ 1:安装 下载Memcache:http://cod ...

  9. HDU 4978 A simple probability problem

    A simple probability problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K ( ...

  10. Babel6.x 转换ES6

    本文介绍Babel6.x的安装过程~ 首先呢,可以使用Babel在线转换 https://babeljs.io/repl/ 然后进入主题:安装Babel(命令行环境,针对Babel6.x版本) 1.首 ...