Skip to content

Instantly share code, notes, and snippets.

@KT-Yeh
Created February 1, 2014 14:50
Show Gist options
  • Save KT-Yeh/8753285 to your computer and use it in GitHub Desktop.
Save KT-Yeh/8753285 to your computer and use it in GitHub Desktop.
#include <cstdio>
using namespace std;
int main()
{
// freopen("input.txt","rt",stdin);
char keyboard[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
char line[1000];
while (gets(line)){
for (int i=0; line[i]; i++){
if (line[i] == ' ') printf(" ");
else{
int j = 0;
while (line[i] != keyboard[j+1]) j++;
printf("%c",keyboard[j]);
}
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment