/*
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 */
/* Description:
If the letter is between 'Z', then print 'A', otherwise print the next letter.
*/ <pre>
#include<stdio.h>
#include<string.h> int main(){
int n,i,j;
char str[50];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",str);
printf("String #%d\n",i+1);
for(j=0;j<strlen(str);j++){
if(str[j]=='Z')
str[j]='A';
else
str[j]=str[j]+1;
}
printf("%s\n\n",str);
} return 0;
}

ZOJ 1240 IBM Minus One的更多相关文章

  1. ZOJ Problem Set - 1240 IBM Minus One

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

  2. IBM Minus One(water)

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

  3. HDU 1328 IBM Minus One

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

  4. IBM Minus One

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

  5. IBM Minus One 简单字符处理

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

  6. zoj 1240

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

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

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

  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. POJ 1202 Family 概率,DP,高精 难度:2

    http://poj.org/problem?id=1202 难度集中在输出格式上,因为输出格式所以是高精度 递推式: 血缘肯定只有从双亲传到儿子的,所以,设f,m为双亲,son为儿子,p[i][j] ...

  2. 火车安排问题(dp好题)

    火车站内往往设有一些主干线分叉出去的铁路支路,供火车停靠,以便上下客或装载货物.铁路 支路有一定长度:火车也有一定的长度,且每列火车的长度相等. 假设某东西向的铁路上,有一小站.该站只有一条铁路支路可 ...

  3. JAVA传智 DAY1复习

    Java平台: Java API JVM 特点:可跨平台 Java运行机制: 编译(javac.exe)                                  运行(java.exe) J ...

  4. mysql.default_socket 和 mysqli.default_socket

    php.ini 里面mysql.default_socket 和 mysqli.default_socket 设置必须要和mysql里面的值一样,否则连接mysql会提示错误

  5. CodeIgniter 引入自定义公共函数

    CodeIgniter 中公共函数不能追加,可以通过 helper 辅助函数实现. 创建 common_helper.php 文件,定义所需公共函数,存放至 application/helpers 目 ...

  6. ToolBar+DrawerLayout + NavigationView

    http://www.jianshu.com/p/9471b87f2c61 很好的博客可以瞅瞅 <android.support.design.widget.NavigationView and ...

  7. MapReduce实现TopK的示例

    由于开始学习MapReduce编程已经有一段时间了,作为一个从编程中寻找自信和乐趣以及热爱编程的孩子来讲,手开始变得很“痒”了,很想小试一下身手.于是自己编写了TopK的代码.TopK的意思就是从原文 ...

  8. C#基础--面向过程计算器

    //面向过程计算器 //思路: 需要注意的是: 两个数相除 除数不能为0: //1.提示用户输入 //2.进行运算 //3.得到结果 Console.WriteLine("请输入第一个数字: ...

  9. C++使用POST方法向网页提交数据-----C++发送HTTP数据获取Google天气预报

    例1:C++使用POST方法向网页提交数据    转自:http://www.it165.net/pro/html/201208/3534.html 在C++中可以使用POST方法向网页中提交数据,这 ...

  10. 2016 - 1 - 22 HTTP(二)

    一: 发送HTTP请求的方法 1.在HTTP/1.1中规定了8种发送请求的方法: 2.发送请求时需要参数,比如POST中的账号密码 二:POST与GET的对比 1.GET与POST的主要区别表现在数据 ...