Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

打表打表附代码

Posted by TSERROF at 2012-08-16 14:00:02 on Problem 2538
#include <iostream>
#include <string>
using namespace std;
char trasfer(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()
{
	string text;
	while(getline(cin,text))
	{
		for (int i=0;i!=text.size();++i) text[i]=trasfer(text[i]);
		cout<<text<<endl;
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator