IBM Minus One

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3943 Accepted Submission(s): 1519
 
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
 
 
Source
Southwestern Europe 1997, Practice
 
Recommend
Ignatius.L
 

调用了库函数

 #include <iostream>
#include <cstdio> using namespace std; int main(){
int n;
scanf("%d",&n); int i;
for(i = ; i < n ; ++i){
string str;
cin >> str; int length = str.length(); // 提取字符串的长度 是关键
int j;
for(j = ; j < length ; ++j){
if(str[j] == 'Z'){
str[j] = 'A';
}else{
str[j] += ;
}
} cout << "String #" << (i+) <<endl;
cout<<str<<endl<<endl;
} return ;
}

IBM Minus One的更多相关文章

  1. IBM Minus One(water)

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

  2. HDU 1328 IBM Minus One

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

  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. HDU ACM-Steps

    HDU ACM-Steps RECORD Chapter 1 Section 1 暖手题 1.1.1 A+B for Input-Output Practice (I) #include <st ...

随机推荐

  1. js调用父框架函数

    if (window.parent && window.parent.frames["frame_main"]) { alert(window.parent.fra ...

  2. iOS 监听声音按键

    有时在项目中需要监听用户是否按下了物理声音键,然后来做某些操作,如:你自定义了一个照相功能,希望用户按下声音按键时也能进行拍照,苹果自带的照相机就有这种功能. 监听物理声音键是否按下的方法有很多中,我 ...

  3. SpringMVC入门笔记一

    SpringMVC优势    性能比struts2好    简单 便捷 易学    和Spring无缝集成(使用spring ioc aop)    约定优于配置    能够简单进行Junit测试   ...

  4. myeclipse 配置 resin-pro-4.0.34

    热部署: 在 resin.xml 文件下 增加 <host id="" root-directory="."> <!-- webapps ca ...

  5. TFTP:简单文本传输协议,BOOTP:引导程序协议

    TFTP:简单文本传输协议,BOOTP:引导程序协议 1.TFTP:      TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用 ...

  6. SVN Access to '/svn/Test/!svn/me' forbidden,不能更新解决办法

    从之前的电脑将Repositorise复制到现在用的PC,出现可以checkout但是不能update的问题.在网上找到以下解决方法,均未能解决. 1.确认URL跟实际一致: 2.确认用户名密码正确: ...

  7. 验证视图状态 MAC 失败,解决方法

    错误信息 今天调试一个带cookie表单提交的页面时,浏览器中报错提示:验证视图状态 MAC 失败.如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 v ...

  8. 项目开发之分页---异步分页(ajax)

    PS:前面忘了给大家讲解后台需要做的 ,同步分页的时候,我们只需要定义一个方法,给前台传递一个page对象,前台接收到直接展示即可:异步分页要多一步,首先还是写一个方法,传递初始对象,后面的ajax返 ...

  9. python基础4

    内容概要: 一.递归 递归就是函数本身调用自己,直到满足指定条件之后一层层退出函数 递归特性: 必须有一个明确的结束条件 每次进入更深一层递归时,问题规模相比上次递归都应有所减少 递归效率不高,递归层 ...

  10. 链接中的href=#是什么意思呢

    链接当前页面. ------------------- 通常有如下用法: <a href="#" onclick="window.close()"> ...