POJ 2538 WERTYU G++

#include <iostream>
#include <string>
#include <vector>
//谢谢博友翻译 博友的程序很棒可以当例题 
using namespace std;
int main()
{
	vector<string> hi;
	while(1)
	{
		string a;
		getline(cin,a);
		if(cin.eof()==1)
		{
			break;
		}
		for(int i=0;i<a.size();i++)
		{
			if(a[i]=='1')
			{
				a[i]='`';
			}else if(a[i]=='2')
			{
				a[i]='1';
			}else if(a[i]=='3')
			{
				a[i]='2';
			}else if(a[i]=='4')
			{
				a[i]='3';
			}else if(a[i]=='5')
			{
				a[i]='4';
			}else if(a[i]=='6')
			{
				a[i]='5';
			}else if(a[i]=='7')
			{
				a[i]='6';
			}else if(a[i]=='8')
			{
				a[i]='7';
			}else if(a[i]=='9')
			{
				a[i]='8';
			}else if(a[i]=='0')
			{
				a[i]='9';
			}else if(a[i]=='-')
			{
				a[i]='0';
			}else if(a[i]=='=')
			{
				a[i]='-';
			}else if(a[i]=='W')
			{
				a[i]='Q';
			}else if(a[i]=='E')
			{
				a[i]='W';
			}else if(a[i]=='R')
			{
				a[i]='E';
			}else if(a[i]=='T')
			{
				a[i]='R';
			}else if(a[i]=='Y')
			{
				a[i]='T';
			}else if(a[i]=='U')
			{
				a[i]='Y';
			}else if(a[i]=='I')
			{
				a[i]='U';
			}else if(a[i]=='O')
			{
				a[i]='I';
			}else if(a[i]=='P')
			{
				a[i]='O';
			}else if(a[i]=='[')
			{
				a[i]='P';
			}else if(a[i]==']')
			{
				a[i]='[';
			}else if(a[i]=='\\')
			{
				a[i]=']';
			}else if(a[i]=='S')
			{
				a[i]='A';
			}else if(a[i]=='D')
			{
				a[i]='S';
			}else if(a[i]=='F')
			{
				a[i]='D';
			}else if(a[i]=='G')
			{
				a[i]='F';
			}else if(a[i]=='H')
			{
				a[i]='G';
			}else if(a[i]=='J')
			{
				a[i]='H';
			}else if(a[i]=='K')
			{
				a[i]='J';
			}else if(a[i]=='L')
			{
				a[i]='K';
			}else if(a[i]==';')
			{
				a[i]='L';
			}else if(a[i]=='\'')
			{
				a[i]=';';
			}else if(a[i]=='X')
			{
				a[i]='Z';
			}else if(a[i]=='C')
			{
				a[i]='X';
			}else if(a[i]=='V')
			{
				a[i]='C';
			}else if(a[i]=='B')
			{
				a[i]='V';
			}else if(a[i]=='N')
			{
				a[i]='B';
			}else if(a[i]=='M')
			{
				a[i]='N';
			}else if(a[i]==',')
			{
				a[i]='M';
			}else if(a[i]=='.')
			{
				a[i]=',';
			}else if(a[i]=='/')
			{
				a[i]='.';
			}
		}
		hi.push_back(a);
	}
	for(int i=0;i<hi.size();i++)
	{
		cout<<hi[i]<<endl;
	}
	return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值