#include<bits/stdc++.h>
using namespace std;
char s1[]= {"-=_+qwertyuiop[]QWERTYUIOP{}asdfghjkl;'ASDFGHJKL:\"zxcvbnm,./ZXCVBNM<>?"};
char s2[]= {"[]{}',.pyfgcrl/=\"<>PYFGCRL?+aoeuidhtns-AOEUIDHTNS_;qjkxbmwvz:QJKXBMWVZ"};
char change(char c)
{
for(int i=0;s1[i]!='\0';i++)
if(s1[i]==c)
return s2[i];
return c;
}
int main()
{
char c;
while(~scanf("%c",&c))
{
printf("%c",change(c));
}
return 0;
}
就是直接暴力
字母顺序太麻烦了!!!
字母大写小写分别对应字符是否加shift