IBM Minus One
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 |
|
Sample Output
String #1 |
|
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的更多相关文章
- IBM Minus One(water)
IBM Minus One Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- HDU 1328 IBM Minus One
IBM Minus One Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- IBM Minus One 简单字符处理
IBM Minus One Time Limit: 2 Seconds Memory Limit: 65536 KB You may have heard of the book '2001 ...
- 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 ...
- HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)
Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...
- ZOJ Problem Set - 1240 IBM Minus One
水题不解释,就是注意下格式,没输出一行字符串记得加一个空白行 #include <stdio.h> #include <string.h> int main() { ; ]; ...
- 杭电ACM分类
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- HDU ACM-Steps
HDU ACM-Steps RECORD Chapter 1 Section 1 暖手题 1.1.1 A+B for Input-Output Practice (I) #include <st ...
随机推荐
- UML六种关系
UML六种关系 基础之上,并对其进行了扩展.在程序中是通过继承类实现的.比如狗是对动物的具体描述,在面向对象设计的时候一般把狗设计为动物的子类. 表示方法:空心三角形箭头的实线,子类指向父类 实现 概 ...
- macvim打造python IDE
昨天安装了macvim,今天在上面配置了一下python的ide: 大家也可参考http://blog.dispatched.ch/2009/05/24/vim-as-python-ide/ 1.文法 ...
- SharePoint RBS 安装(集成Office Web Apps)
前言 本文完全原创,转载请说明出处,希望对大家有用. 本篇博客是个人总结,一方面以便日后查看,另一方面希望能为其他人提供一些便利. 阅读目录 安装RBS 为多个内容数据库开启RBS 正文 目的:在Sh ...
- 自定义的UIAlertView不能在iOS7上正常显示
众所周知,当伟大的iOS7系统发布后,表扬的一堆.谩骂的也一片,而对于我们程序员来说最关心的莫过于低版本系统上的程序在搞版本系统上的兼容性问题了. 在iOS6.1几之前,当我们想要做一些提醒用户或临时 ...
- 完整显示当前日期和时间的JS代码(2007年2月25日星期日正午12:42:48)
代码演示效果为“2007年2月25日星期日正午12:42:48”. 使用方法:将下面的JS代码放到你想要显示的页面中(支持HTML页面),然后在你想要显示时间的位置插入下面的代码即可 <div ...
- sftp 服务器外网访问设置
这个是需要在本机上设定用户名的.根据不同的用户权限.然后让不同的人来到本机上取得数据. 参考一下有用的文章:http://www.ericstockwell.com/?p=54 (强烈建议 ...
- Eclipse代码自动提示设置
以前百度过如何设置Eclipse代码自动提示,但是本人记性不好,所以把这个方法写成一篇日志,这样以后就不用百度了,直接看自己的博客就是了,而且还增加了自己博客的点击量.以下是从各个地方看到总结的方法: ...
- Android开发之Ubuntu上Eclipse不显示手机设备
一.准备工作 A.开启Android设备,用USB数据线连接到Ubuntu系统. B.启用设备的USB调试模试 C.启动Eclipse,在Devices栏会现一个有很多???号的不明设备 ...
- linux内核——进程,轻量级进程,线程,线程组
1.进程.轻量级进程.线程.线程组之间的关系 2.及它们的标识相关说明 一.进程.轻量级进程.线程.线程组之间的关系 借助上图说明: 进程P0有四条执行流,即线程, 主线程t0是它的第一个线程,且与进 ...
- Web自动化测试学习点总结
"大不可量,深不可测"这是出自<韩非子·主道>的一段话.关于自动化测试也是如此,web系统开发完成,测试人员对页面进行测试,寻找bug.这个过程,需要摸索着前进. 什么 ...