前言
什么叫人工智障,这就是人工智障
一、分析
就是将给出的字符,再键盘上找出左边相邻的字符即可,所以我用了一种特别智障的方法(笑)
二、代码
代码如下(示例):
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char change(char ch)
{
if(ch=='W')ch='Q';
else if(ch=='S')ch='A';
else if(ch=='X')ch='Z';
else if(ch=='E')ch='W';
else if(ch=='D')ch='S';
else if(ch=='C')ch='X';
else if(ch=='R')ch='E';
else if(ch=='F')ch='D';
else if(ch=='V')ch='C';
else if(ch=='T')ch='R';
else if(ch=='G')ch='F';
else if(ch=='B')ch='V';
else if(ch=='Y')ch='T';
else if(ch=='H')ch='G';
else if(ch=='N')ch='B';
else if(ch=='U')ch='Y';
else if(ch=='J')ch='H';
else if(ch=='M')ch='N';
else if(ch=='I')ch='U';
else if(ch=='K')ch='J';
else if(ch==',')ch='M';
else if(ch=='O')ch='I';
else if(ch=='L')ch='K';
else if(ch=='.')ch=',';
else if(ch=='P')ch='O';
else if(ch=='[')ch='P';
else if(ch==']')ch='[';
else if(ch=='\\')ch=']';
else if(ch==';')ch='L';
else if(ch=='/')ch='.';
else if(ch=='2')ch='1';
else if(ch=='3')ch='2';
else if(ch=='4')ch='3';
else if(ch=='5')ch='4';
else if(ch=='6')ch='5';
else if(ch=='7')ch='6';
else if(ch=='8')ch='7';
else if(ch=='9')ch='8';
else if(ch=='0')ch='9';
else if(ch=='-')ch='0';
else if(ch=='=')ch='-';
else if(ch=='\'')ch=';';
return ch;
}
int main()
{
char s[5000];
while(gets(s))
{
int i;
for (i=0;i<strlen(s);i++)
s[i]=change(s[i]);
puts(s);
}
return 0;
}
总结
不愧是我