Last active
August 29, 2015 13:56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cctype> | |
using namespace std; | |
const char keyboard[] = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./"; | |
int main() | |
{ | |
char c; | |
while (scanf("%c",&c) != EOF){ | |
c = tolower(c); //換成小寫字母 | |
if (isspace(c)) printf("%c",c); //如果為' '或'\n'直接輸出 | |
else{ | |
for (int i=0; keyboard[i]; ++i) | |
if (c == keyboard[i]){ | |
printf("%c",keyboard[i-2]); | |
break; | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment