J - Convert QWERTY to Dvorak——ZOJ

J - Convert QWERTY to Dvorak

Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld
& %llu

Submit Status

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
`[email protected]#$%^&*()}"‘]_+-=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
`[email protected]#$%^&*()+_-={}[]:"‘<>,.?/\|
ABCDEFuvwxyz
AXJE>Ugk,qf;
#include<stdio.h>
#include<string.h>
	int i;
	char s[10000010];
int main()
{

	while(gets(s)!=NULL)
	{
		i=0;
		while(s[i]!='\0')
		{
			if(s[i]=='_') s[i]='{';
			else if(s[i]=='-') s[i]='[';
			else if(s[i]=='+') s[i]='}';
			else if(s[i]=='=') s[i]=']';
			else if(s[i]=='Q') s[i]='"';
			else if(s[i]=='q') s[i]=39;
			else if(s[i]=='W') s[i]='<';
			else if(s[i]=='w') s[i]=',';
			else if(s[i]=='E') s[i]='>';
			else if(s[i]=='e') s[i]='.';
			else if(s[i]=='R') s[i]='P';
			else if(s[i]=='r') s[i]='p';
			else if(s[i]=='T') s[i]='Y';
			else if(s[i]=='t') s[i]='y';
			else if(s[i]=='Y') s[i]='F';
			else if(s[i]=='y') s[i]='f';
			else if(s[i]=='U') s[i]='G';
			else if(s[i]=='u') s[i]='g';
			else if(s[i]=='I') s[i]='C';
			else if(s[i]=='i') s[i]='c';
			else if(s[i]=='O') s[i]='R';
			else if(s[i]=='o') s[i]='r';
			else if(s[i]=='P') s[i]='L';
			else if(s[i]=='p') s[i]='l';
			else if(s[i]=='{') s[i]='?';
			else if(s[i]=='[') s[i]='/';
			else if(s[i]=='}') s[i]='+';
			else if(s[i]==']') s[i]='=';
			else if(s[i]=='S') s[i]='O';
			else if(s[i]=='s') s[i]='o';
			else if(s[i]=='D') s[i]='E';
			else if(s[i]=='d') s[i]='e';
			else if(s[i]=='F') s[i]='U';
			else if(s[i]=='f') s[i]='u';
			else if(s[i]=='G') s[i]='I';
			else if(s[i]=='g') s[i]='i';
			else if(s[i]=='H') s[i]='D';
			else if(s[i]=='h') s[i]='d';
			else if(s[i]=='J') s[i]='H';
			else if(s[i]=='j') s[i]='h';
			else if(s[i]=='K') s[i]='T';
			else if(s[i]=='k') s[i]='t';
			else if(s[i]=='L') s[i]='N';
			else if(s[i]=='l') s[i]='n';
			else if(s[i]==':') s[i]='S';
			else if(s[i]==';') s[i]='s';
			else if(s[i]=='"') s[i]='_';
			else if(s[i]==39)  s[i]='-';
			else if(s[i]=='Z') s[i]=':';
			else if(s[i]=='z') s[i]=';';
			else if(s[i]=='X') s[i]='Q';
			else if(s[i]=='x') s[i]='q';
			else if(s[i]=='C') s[i]='J';
			else if(s[i]=='c') s[i]='j';
			else if(s[i]=='V') s[i]='K';
			else if(s[i]=='v') s[i]='k';
			else if(s[i]=='B') s[i]='X';
			else if(s[i]=='b') s[i]='x';
			else if(s[i]=='N') s[i]='B';
			else if(s[i]=='n') s[i]='b';
			else if(s[i]=='<') s[i]='W';
			else if(s[i]==',') s[i]='w';
			else if(s[i]=='>') s[i]='V';
			else if(s[i]=='.') s[i]='v';
			else if(s[i]=='?') s[i]='Z';
			else if(s[i]=='/') s[i]='z';
			i++;
		}
		puts(s);
	}
	return 0;
 } 
时间: 2024-10-12 11:23:30

J - Convert QWERTY to Dvorak——ZOJ的相关文章

12th浙江省省赛 J Convert QWERTY to Dvorak(细节模拟题)

Convert QWERTY to Dvorak Time Limit: 2 Seconds      Memory Limit: 65536 KB Edward, a poor copy typist, is a user of the Dvorak Layout.But now he has only a QWERTY Keyboard with a brokenCaps Lockkey, so Edward never presses the brokenCaps Lockkey.Luck

模拟 ZOJ 3878 Convert QWERTY to Dvorak

题目传送门 1 /* 2 模拟:手敲map一一映射,累! 3 除了忘记读入字符串不能用gets用getline外还是很顺利的AC了:) 4 */ 5 #include <cstdio> 6 #include <iostream> 7 #include <algorithm> 8 #include <cmath> 9 #include <cstring> 10 #include <string> 11 #include <map&

zoj 3878 Convert QWERTY to Dvorak【好坑的模拟】

Convert QWERTY to Dvorak Time Limit: 2 Seconds      Memory Limit: 65536 KB 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

Convert QWERTY to Dvorak

Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3878 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 E

ACM学习历程—ZOJ3878 Convert QWERTY to Dvorak(Hash &amp;&amp; 模拟)

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.

OJ Problem Set - 3878 Convert QWERTY to Dvorak

题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3878 1 /* 2 问题 3 很有意思的一道题目,纯模拟,注意细节和最后一行的空格就行了 4 */ 5 6 #include<iostream> 7 #include<string> 8 #include<map> 9 using namespace std; 10 11 int main() 12 { 13 map<char,

ZOJ 3878-Convert QWERTY to Dvorak【模拟】

Convert QWERTY to Dvorak Time Limit: 2 Seconds      Memory Limit: 65536 KB 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

2015浙江省赛

ZOJ 3872 :Beauty of Array 对于每个数,计算这个数被累加的次数.找到这个数左边这个数出现的地方,在这之间的所有数的数量*这个数后面的数的数量,即为这个数被计算的次数 <code class="hljs cpp has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pr

2年后,还是放弃了programmer dvorak

写下此文纪念我长达两年的dvorak(以及programmer dvorak,下面都统称dvorak)的使用历程,也给想转换到dvorak的童鞋一些参考经验. 具体的开始时间记不清了,应该是大二的某个时候.那时正是喜欢折腾的时候,折腾过一众linux发行版,ubuntu,xubuntu,fedora,opensuse,还有傻傻装个puppy,做启动U盘到图书馆用那硬盘只有16G的瘦客户机,体验着残缺不全的系统,还不能上网,当时还觉的特自豪. 就是那时听说了dvorak, 这感觉就像高二的时候初识