Description

Edward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a broken Caps Lock key, so Edward never presses the broken Caps Lock key. Luckily, all the other keys on the QWERTY keyboard work well. Every day, he has a lot of documents to type. Thus he needs a converter to translate QWERTY into Dvorak. Can you help him?

The QWERTY Layout and the Dvorak Layout are in the following:

The QWERTY Layout


The Dvorak Layout

Input

A QWERTY document Edward typed. The document has no more than 100 kibibytes. And there are no invalid characters in the document.

Output

The Dvorak document.

Sample Input

Jgw Gqm Andpw a H.soav Patsfk f;doe
Nfk Gq.d slpt a X,dokt vdtnsaohe
Kjd yspps,glu pgld; aod yso kd;kgluZ
1234567890
`~!@#$%^&*()}"']_+-=ZQqWEwe{[\|
ANIHDYf.,bt/
ABCDEFuvwxyz

Sample Output

Hi, I'm Abel, a Dvorak Layout user.
But I've only a Qwerty keyboard.
The following lines are for testing:
1234567890
`~!@#$%^&*()+_-={}[]:"'<>,.?/\|
ABCDEFuvwxyz
AXJE>Ugk,qf;

这个题直接暴力手打了两张表,然后用map进行了映射。

代码:

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <string> using namespace std; char from[100] =
{
'~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
'`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '|',
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\\',
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?',
'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', ' '
};
char to[100] =
{
'~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '{', '}',
'`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '[', ']',
'"', '<', '>', 'P', 'Y', 'F', 'G', 'C', 'R', 'L', '?', '+', '|',
'\'',',', '.', 'p', 'y', 'f', 'g', 'c', 'r', 'l', '/', '=', '\\',
'A', 'O', 'E', 'U', 'I', 'D', 'H', 'T', 'N', 'S', '_',
'a', 'o', 'e', 'u', 'i', 'd', 'h', 't', 'n', 's', '-',
':', 'Q', 'J', 'K', 'X', 'B', 'M', 'W', 'V', 'Z',
';', 'q', 'j', 'k', 'x', 'b', 'm', 'w', 'v', 'z', ' '
}; char str; int main()
{
//freopen("test.in", "r", stdin);
map<char, char> Hash;
for (int i = 0; i < 100; ++i)
Hash[from[i]] = to[i];
while ((str = getchar()) != EOF)
{
if(str == '\n')
printf("\n");
else
printf("%c", Hash[str]);
}
return 0;
}

最新文章

  1. 了解了下spring boot,说一下看法
  2. 学习Coding-iOS开源项目日志(五)
  3. URL优化之IIS7如何开启伪静态
  4. ytu 1059: 判别该年份是否闰年(水题,宏定义)
  5. 黄聪:WebBrowser执行和安装jQuery脚本(IEBrowse)
  6. 炼数成金hadoop视频干货05
  7. 安装ADT
  8. masonry结合json 制作无限滚动的瀑布流
  9. Bootstrap Alert 使用
  10. 初识Ubuntu
  11. 【原创】源码角度分析Android的消息机制系列(三)——ThreadLocal的工作原理
  12. VR虚拟现实技术在教育领域的前景展望
  13. BZOJ1565 植物大战僵尸 题解
  14. Linux集群时间同步方法
  15. Windows系统封装教程
  16. vue+cordova构建跨平台应用集成并使用Cordova plugin
  17. [转] Understanding-LSTMs 理解LSTM
  18. Chrome禁止http自动转为https
  19. [adminitrative][archlinux][setfont] 设置console的字体大小
  20. Received empty response from Zabbix Agent at [172.16.1.7]...

热门文章

  1. Spring学习七----------Bean的配置之自动装配
  2. GIT简单使用——私人库篇
  3. Effective Java - [3. 对象通用方法]
  4. MySQL技术内幕InnoDB存储引擎(表&amp;索引算法和锁)
  5. 如何在linux下解压缩rar格式的文件压缩包
  6. C#抓取网面上的html内容(JS动态生成的无法抓取)
  7. hunnu--11548--找啊找啊找朋友
  8. Git 自己的一些工作中的总结
  9. 【BZOJ3864】Hero meet devil DP套DP
  10. EasyNVR H5无插件摄像机直播解决方案前端解析之:videojs的使用