http://acm.hit.edu.cn/hoj/problem/view?id=1853
输入字符 输出键盘上该字符左边的字符
#include <stdio.h>
char s[48]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
void transfrom(char c);
int main()
{
char str[100];
int i;
while (gets(str))
{
for (i = 0; str[i]; i++)
transfrom(str[i]);
printf("\n");
}
return 0;
}
void transfrom(char c)
{
int i;
for(i=0; i<48; i++)
{
if( c == s[i] )
{
printf("%c",s[i-1]);
return;
}
}
printf("%c",c);
}