POJ2538:WERTYU
来源:互联网 发布:客服软件忠仕 编辑:程序博客网 时间:2024/05/22 23:17
Description
A common typing error is to place the hands on the keyboard one row to the right of the correct position. So "Q" is typed as "W" and "J" is typed as "K" and so on. You are to decode a message typed in this manner.
Input
Input consists of several lines of text. Each line may contain digits, spaces, upper case letters (except Q, A, Z), or punctuation shown above [except back-quote (`)]. Keys labelled with words [Tab, BackSp, Control, etc.] are not represented in the input.
Output
You are to replace each letter or punctuation symbol by the one immediately to its left on the QWERTY keyboard shown above. Spaces in the input should be echoed in the output.
Sample Input
O S, GOMR YPFSU/
Sample Output
I AM FINE TODAY.
//其实我真的不想这样做的,真的。
#include <iostream>#include <cstdio>#include <cstring>using namespace std;char trasfer(char ch){if(ch=='W')ch='Q';else if(ch=='S')ch='A';else if(ch=='X')ch='Z';else if(ch=='E')ch='W';else if(ch=='D')ch='S';else if(ch=='C')ch='X';else if(ch=='R')ch='E';else if(ch=='F')ch='D';else if(ch=='V')ch='C';else if(ch=='T')ch='R';else if(ch=='G')ch='F';else if(ch=='B')ch='V';else if(ch=='Y')ch='T';else if(ch=='H')ch='G';else if(ch=='N')ch='B';else if(ch=='U')ch='Y';else if(ch=='J')ch='H';else if(ch=='M')ch='N';else if(ch=='I')ch='U';else if(ch=='K')ch='J';else if(ch==',')ch='M';else if(ch=='O')ch='I';else if(ch=='L')ch='K';else if(ch=='.')ch=',';else if(ch=='P')ch='O';else if(ch=='[')ch='P';else if(ch==']')ch='[';else if(ch=='\\')ch=']';else if(ch==';')ch='L';else if(ch=='/')ch='.';else if(ch=='2')ch='1';else if(ch=='3')ch='2';else if(ch=='4')ch='3';else if(ch=='5')ch='4';else if(ch=='6')ch='5';else if(ch=='7')ch='6';else if(ch=='8')ch='7';else if(ch=='9')ch='8';else if(ch=='0')ch='9';else if(ch=='-')ch='0';else if(ch=='=')ch='-';else if(ch=='\'')ch=';';return ch;}int main(){char str[10000];while(gets(str)){for (int i=0;i<strlen(str);++i)str[i]=trasfer(str[i]);puts(str);}return 0;}
- poj2538 WERTYU
- POJ2538:WERTYU
- 北大ACM poj2538 WERTYU
- POJ2538 ZOJ1884 UVA10082 WERTYU
- poj2538
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- WERTYU
- Android性能调优
- ads1.2的Error starting extrnal proces. Process Error Code 87 (0x57)
- Java Filewriter的使用
- 如何对付团队中的“害群之马”
- UI原型设计软件Axure
- POJ2538:WERTYU
- 戒、定、慧三学
- 一个很好的工具网站推荐
- error LNK2019: 无法解析的外部符号(编程解决方法)
- C++程序设计-第3周 第一次见到了对象
- 线性表之单链表 图解和代码实现
- node.js入门指导
- 追加简述SurfaceView 与 GLSurfaceView效率
- hdoj 1671Phone List 字典树