HDU WERTYU

前言

什么叫人工智障,这就是人工智障

一、分析

就是将给出的字符,再键盘上找出左边相邻的字符即可,所以我用了一种特别智障的方法(笑)

二、代码

代码如下(示例):

#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;
}

总结

不愧是我

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值