10222 - Decode the Mad man

一个学生创造了程序,能解码一位使用特殊语言的老教授的话语。输入编码消息,程序将其转换为正常语言。任务简单,只需替换每个字符为键盘上左第二位的字符。

 

The Problem

Once in BUET, an old professor had gone completely mad. He started talking with some peculiar words. Nobody could realize his speech and lectures. Finally the BUET authority fall in great trouble. There was no way left to keep that man working in university. Suddenly a student (definitely he was a registered author at UVA ACM Chapter and hold a good rank on 24 hour-Online Judge) created a program that was able to decode that professor’s speech. After his invention, everyone got comfort again and that old teacher started his everyday works as before.

So, if you ever visit BUET and see a teacher talking with a microphone, which is connected to a IBM computer equipped with a voice recognition software and students are taking their lecture from the computer screen, don’t get thundered! Because now your job is to write the same program which can decode that mad teacher's speech!

The Input

The input file will contain only one test case i.e. the encoded message.

The test case consists of one or more words.

The Output

For the given test case, print a line containing the decoded words. However, it is not so hard task toreplace each letter or punctuation symbol by the two immediately to its left alphabet on your standard keyboard.

 问题
很久以前,在波兰的BUET大学有一个老教授完全发疯了。他开始用很特殊的文字来说话。没有人可以听得懂他的演讲及授课。最后,BUET终于陷入了难题。再也没有方法可以让他继续在大学里工作了。突然有一个学生(当然是UVA ACM学会注册的作者,并在24小时线上裁判系统上有很好的排名) 创造了一个可以将教授的话解码的程式。在此之后,这个老教授开始一如往常般地工作,每个人也都松了一口气。

因此,如果你有机会去到BUET,看到一个老师透过一个接到装有语音辨识的IBM电脑的麦克风说话,而学生则从电脑萤幕上听课,你可别吓到!因为现在你的工就是要写一个一样可以解码这个疯教授语言的程式。

输入
输入档仅含一笔测试资料,也就是编码后的讯息。

这笔测试资料含有一个或多个单字。

输出
就所给的测试资料,将解码后的单字印在一行。还好,这工作并不难,只要把每个字母或符号以键盘上在它左边第二个键的符号来取代就行了。

Sample Input

k[r dyt I[o

Sample Output

how are you
解题思路:一个一个对应输入,每个字符对应的是在键盘上左边的第二个键,如k对应h,
#include<stdio.h>
int main()
{char a;
while((a=getchar())!=EOF){
                          if(a=='\\')printf("[");
                          else if(a==']')printf("p");
                          else if(a=='[')printf("o");
                          else if(a=='P'||a=='p')printf("i");
                          else if(a=='O'||a=='o')printf("u");
                          else if(a=='I'||a=='i')printf("y");
                          else if(a=='U'||a=='u')printf("t");
                          else if(a=='Y'||a=='y')printf("r");
                          else if(a=='T'||a=='t')printf("e");
                          else if(a=='R'||a=='r')printf("w");
                          else if(a=='E'||a=='e')printf("q");
                          else if(a=='\'')printf("l");
                          else if(a==';')printf("k");
                          else if(a=='L'||a=='l')printf("j");
                          else if(a=='K'||a=='k')printf("h");
                          else if(a=='J'||a=='j')printf("g");
                          else if(a=='H'||a=='h')printf("f");
                          else if(a=='G'||a=='g')printf("d");
                          else if(a=='F'||a=='f')printf("s");
                          else if(a=='D'||a=='d')printf("a");
                          else if(a=='S'||a=='s')printf("\\");
                          else if(a=='/')printf(",");
                          else if(a=='.')printf("m");
                          else if(a==',')printf("n");
                          else if(a=='M'||a=='m')printf("b");
                          else if(a=='N'||a=='n')printf("v");
                          else if(a=='B'||a=='b')printf("c");
                          else if(a=='V'||a=='v')printf("x");
                          else if(a=='C'||a=='c')printf("z");
                          else if(a=='X'||a=='x')printf("'");
                          else if(a=='A'||a=='a')printf("]");
                          else if(a=='Z'||a=='z')printf(";");
                          else printf("%c",a);
                          }
return 0;
}


 

转载于:https://www.cnblogs.com/EVA00/archive/2013/02/05/2893033.html

标题基于Python的自主学习系统后端设计与实现AI更换标题第1章引言介绍自主学习系统的研究背景、意义、现状以及本文的研究方法和创新点。1.1研究背景与意义阐述自主学习系统在教育技术领域的重要性和应用价值。1.2国内外研究现状分析国内外在自主学习系统后端技术方面的研究进展。1.3研究方法与创新点概述本文采用Python技术栈的设计方法和系统创新点。第2章相关理论与技术总结自主学习系统后端开发的相关理论和技术基础。2.1自主学习系统理论阐述自主学习系统的定义、特征和理论基础。2.2Python后端技术栈介绍DjangoFlask等Python后端框架及其适用场景。2.3数据库技术讨论关系型和非关系型数据库在系统中的应用方案。第3章系统设计与实现详细介绍自主学习系统后端的设计方案和实现过程。3.1系统架构设计提出基于微服务的系统架构设计方案。3.2核心模块设计详细说明用户管理、学习资源管理、进度跟踪等核心模块设计。3.3关键技术实现阐述个性化推荐算法、学习行为分析等关键技术的实现。第4章系统测试与评估对系统进行功能测试和性能评估。4.1测试环境与方法介绍测试环境配置和采用的测试方法。4.2功能测试结果展示各功能模块的测试结果和问题修复情况。4.3性能评估分析分析系统在高并发等场景下的性能表现。第5章结论与展望总结研究成果并提出未来改进方向。5.1研究结论概括系统设计的主要成果和技术创新。5.2未来展望指出系统局限性并提出后续优化方向。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值