/*
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 3522 Slim Span 最小生成树,暴力 难度:0

    kruskal思想,排序后暴力枚举从任意边开始能够组成的最小生成树 #include <cstdio> #include <algorithm> using namespace ...

  2. IPTables系列:如何配置Ubuntu 14.04中的IPTables防火墙

    IPTables基本命令 在向大家介绍复杂防火墙规则之前,还是先上一些简单的料,让大家对IPTables最为基本的命令有一些简单了解. 首先要说明的是IPTables命令必需以root权限运行,这意味 ...

  3. 服务器端与客户端TCP连接入门(一)

    Java中使用Socket(即套接字)完成TCP程序的开发 服务器端使用ServerSocket接收客户端的连接请求,每一个客户端都使用一个Socket对象表示 在服务器端每次运行时都要使用accep ...

  4. function format_number(srcNumber, n) {

    function format_number(srcNumber, n) {var dstNumber = parseFloat(srcNumber);if (isNaN(dstNumber)) {r ...

  5. CodeForces 534D Program B

    Description On February, 30th n students came in the Center for Training Olympiad Programmers (CTOP) ...

  6. 一张图告诉你为什么 Gmail 是最好的邮箱,以及大量私货

    今天早上,我的同事详细介绍了 Gmail 相比其他邮箱的优势,比如强大的垃圾邮件过滤.简单的使用界面.强大的功能设置等等.但是对我来说,这些并不是我使用 Gmail 的最重要原因. 我第一个正式的邮箱 ...

  7. hdu 2068

    ps:长度长到我不想说....WA了无数次...25的阶乘就爆炸... 代码: #include "stdio.h" #define LL long long LL fac(lon ...

  8. 针对电信乌龙事件的深度测试: 广州电信错误将深圳地区189的号码在3G升级4G申请时从广州网厅发货,造成深圳用户收到4G卡后无法激活,深圳电信找不到订单

    广州电信错误将深圳地区189的3G升级4G申请从中国电信广州网厅发货(智能卡号:8986 1114 9002 0851  742X S  电话号码 189),造成用户收到4G卡后无法激活,深圳电信找不 ...

  9. spring mvc + freemarker优雅的实现邮件定时发送

    1. spring mvc工程中引入相关freemarker\mail的包 如:pom.xml中加入类似 <dependency> <groupId>javax.mail< ...

  10. 怎么用sql语句查看某个字段值是否是唯一的

    select count(*) from table group by zd having count(*)>1 这是不唯一的过滤出来的语句