J-Convert QWERTY to DvorakTime
limit:$ MS
Memory Limit:65536KB
64bit IO Format:%lld & Amp %llu SubmitStatus
Description
Edward, a poor copy typist, is a user of the Dvorak Layout. But now he had only a QWERTY Keyboard with a broken Caps Lock key, so Edward never presses the broken Caps Lock key. Luckily, all of the other keys in the QWERTY keyboard work well. Every day, he had 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 is in the following:
Input
A QWERTY document Edward typed. The document has no more than kibibytes. And there is no invalid characters in the document.
Output
The Dvorak document.
Sample Input
JGW Gqm ANDPW a h.soav patsfk f;doenfk gq.d slpt a x,dokt vdtnsaohekjd Yspps,glu pgld; AOD yso kd;kgluz1234567890 ' [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 is for testing:1234567890 ' [email protected]#$%^&* () +_-={}[]: ' <>,.? /\| abcdefuvwxyzaxje>ugk,qf;
#include <stdio.h> #include <string.h>int i;char s[10000010];int main () {while (gets (s)!=null) {I=0;while (s [i]!= ') {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);} Return0; }
J-convert QWERTY to Dvorak--zoj