IBM Minus One(water)
IBM Minus One
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4475 Accepted Submission(s):
2349
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.
- this is the number of strings to follow. The following n lines each contain
one string of at most 50 upper-case letters.
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.
IBM
TXFSD
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int i,N;
//freopen("in.txt","r",stdin);
cin>>N;
getchar();
for(i=;i<=N;i++)
{
char a[];
int len,j;
gets(a);
len=strlen(a);
for(j=;j<len;j++)
{
if(a[j]=='Z')
a[j]='A';
else
a[j]++;
}
cout<<"String #"<<i<<endl<<a<<endl<<endl;
}
}
IBM Minus One(water)的更多相关文章
- 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: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total ...
- 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 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
随机推荐
- Yii 安装
// 安装 composer curl -s http://getcomposer.org/installer | php // 把 composer 添加到全局命令 mv composer.phar ...
- Java中的深复制与浅复制
1.浅复制与深复制概念 ⑴浅复制(浅克隆) 被复制对象的所有变量都含有与原来的对象相同的值,而所有的对其他对象的引用仍然指向原来的对象.换言之,浅复制仅仅复制所考虑的对象,而不 复制它所引用的对象. ...
- Android中动态更新TextView上的文字
示例代码: 1.新线程,定时更新文字 class testThread extends Thread{ public void run() { Message message = new Messag ...
- C# XML序列化帮助类代码
public static class XmlHelper { private static void XmlSerializeInternal(Stream stream, object o, En ...
- VS_QT中配置qDebug输出
在使用qt_create时可以使用qDebug进行调试输出.在VS中也可以使用.但需要配置.配置过程如下图所示: 一.首先右击工程名,选择最后一个选项“Properties” 二.然后选择Linker ...
- First Missing Positive 解答
Question Given an unsorted integer array, find the first missing positive integer. For example,Given ...
- Gas Station 解答
Problem There are N gas stations along a circular route, where the amount of gas at station i is gas ...
- 【转】V4L2+swscale+X264+live555实现流媒体服务端
写这边博客,一方面是因为自己在做项目的时候不太做笔记,怕以后自己忘记了.另一方面,是让正在寻求资料的同行少走一点弯路吧.不能说我这个方案怎么的好,至少是有一点参考价值的.这边博客需要一定基础才能看明白 ...
- where 1=1
sql: where 1=1 1=1 永真, 1<>1 永假. 1<>1 的用处: 用于只取结构不取数据的场合 例如: 拷贝表 create table_name as ...
- php 中利用json_encode和json_decode传递包括特殊字符的数据
</pre><span style="font-size:24px"></span><pre name="code" ...