/*
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. jmeter之json数据参数化 断言等

    在 http Load Testing 中,json 数据的提交是个让人头疼的问题.本文详细介绍如何进行 JMeter 的 json 测试提交,以及如何将其参数化.Step 1 http json 请 ...

  2. 汉字转拼音Pinyin4j工具(C#、Java都可用)

    C#用法: string pinyin=GetStringPinYin("张三"); //方法如下 public static string GetStringPinYin(str ...

  3. Servlet、MySQL中文乱码

    1.Servlet中文乱码: 在doPost或doGet方法里,加上以下两行即可: response.setContentType("text/html;charset=UTF-8" ...

  4. Spring学习笔记之Constructor-based or setter-based DI?

    如果是强制依赖,那么使用构造器注入,如果是可选依赖,那么使用set方法注入.Spring鼓励构造器注入,可以确保依赖项不为null, Since you can mix constructor-bas ...

  5. C++及数据结构笔试面试常见知识点总结

    一些常考的基础知识点个人总结,大神勿喷,欢迎指正. 1.广义表的表尾是指除去表头后剩下的元素组成的表,表头可以为表或单元素值.表尾或为表,或为空表. 2.构造函数不能声明为虚函数. 构造函数为什么不能 ...

  6. 测试bug级别定义

    致命bug:不能完全满足系统要求,系统停止运行,系统的重要部件无法运行,系统崩溃或者挂起等导致系统不能正常运行. 修改优先级为最高,该级别问题需要立即修改. 1.系统崩溃 2.导致程序重启,死机或非法 ...

  7. <select>标签使用方法

    前台页面: <form id="form1" runat="server"> <select runat="server" ...

  8. namenode 无法启动之每次开机需要重新格式化-tmp

    最近遇到了一个问题,执行start-all.sh的时候发现JPS一下namenode没有启动        每次开机都得重新格式化一下namenode才可以        其实问题就出在tmp文件,默 ...

  9. MVC的传递数据的方法

    1.使用ViewBag #region 0.2 Action方法 + ActionResult Index2() /// <summary> /// Action方法 /// </s ...

  10. php中遍历二维数组并以表格的形式输出

    一.索引数组 <?php //使用array()语句结构将联系人列表中所有数据声明为一个二维数组,默认下标是顺序数字索引 $contact1 = array( //定义外层数组 array(1, ...