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 ...
随机推荐
- java生成PDF文件(itext)
itextpdf-5.4.3.jar下载地址: http://www.kuaipan.cn/file/id_58980483773788178.htm 导入itextpdf-5.4.3.jar ToP ...
- mybatis3.4测试CRUD
导入包 H:\jar\jdbc\mysql-connector-java-5.1.13-bin.jarH:\jar\mybatis\mybatis-3.4.1\mybatis-3.4.1.jarH:\ ...
- 添加可运行的js代码
如何在博客园的文章/随笔中添加可运行的js代码 在博客园浏览大牛们写的文章时,经常会看到在文章中混有一些可运行示例,例如司徒正美的博客中: 带有可运行示例 可以点击“运行代码” 经过一番小小的探索,掌 ...
- ArcEngine关于单位转换示例
示例界面: 转换代码: private void Button1_Click(object sender, System.Windows.RoutedEventArgs e) { // Get the ...
- 读写分离子系统 - C# SQL分发子系统(ADO.NET,不支持EF)
读写分离子系统 - C# SQL分发子系统(ADO.NET,不支持EF) 这次介绍的这个框架只适用于中小项目,并且各个读写数据库结构是一致的情况,还要并且是写入数据库只有1台情况. 我们来看看这个子系 ...
- Internet Liberity -- a specific anonymous internet guide
Here we see. Please leave your comments if you have some views. Happy hacking! Free the internet!
- mpi和cuda混合编程的正确编译
针对大数据的计算,很多程序通过搭建mpi集群进行加速,并取得了很好的效果.算法内部的加速,当前的并行化趋势是利用GPU显卡进行算法加速.针对并行性非常好的算法,GPU加速效果将远大于集群带来的加速效果 ...
- hdu1043-素数回文
http://acm.hdu.edu.cn/showproblem.php?pid=1431 整体思想可以理解为打表,可以通过如下办法打表(但是相对比较麻烦),还可以直接使用数组,将所有数据直接存储进 ...
- wireshark查看sip协议流
选择中你要查看的sip消息-----右键--follow udp stream,就可以查看出消息流的整个流程.
- 论移动端Hybid开发
以下内容code地址:https://github.com/wytings/Hybrid 背景:公司业务的发展和开发需求升级,我们需要Hybrid了.市面上有很多开源的Hybrid框架给我们直接使用, ...