#include <stdio.h>
#define REP(i, a, b) for (i=a ; i<b ; i++)
#define FILE freopen("input.txt","r",stdin)
char *ns = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./";
char *nsr = "`123qjlmfp/[]456.orsuyb;=\\789aehtdck-0zx,inwvg'";
char *s = "~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?";
char *sr = "~!@#QJLMFP?{}$%^>ORSUYB:+|&*(AEHTDCK_)ZX<INWVG\"";
char tab[256];
int main() {
int I, LEN1 = strlen(sr), LEN2 = strlen(nsr);
char ch;
REP(I, 0, LEN1) {
tab[s[I]] = sr[I];
}
REP(I, 0, LEN2) {
tab[ns[I]] = nsr[I];
}
while (scanf("%c",&ch)==1) {
if (ch=='\n') putchar('\n');
else if (ch==' ') putchar(' ');
else {
putchar(tab[ch]);
}
}
return 0;
}
Tuesday, September 07, 2010
[UVa] 11278 - One-Handed Typist
Be careful with the Backslash and Quote signs. You need to C Escape both. Use mappings instead of linear search.
Subscribe to:
Post Comments (Atom)
Connect Rapoo MT750S with Linux (Tested on Manjaro)
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
I like coding a lot, keeps me glued to the PC for hours. For that reason it's a need to edit the Syntax Highlighter to suit my eyes for...
-
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
Install MinGW GCC Port on Windows. 1. Just go to this address [ http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/ ]...
No comments:
Post a Comment
Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.