Problem
#include<stdio.h>
#define max 50000
int main()
{
int key[255]={0},i;
char str[max];
key[1]='`';
key[2]='1';
key[3]='2';
key[4]='3';
key[5]='4';
key[6]='5';
key[7]='6';
key[8]='7';
key[9]='8';
key[0]='9';
key['-']='0';
key['=']='-';
key['W']='Q';
key['E']='W';
key['R']='E';
key['T']='R';
key['Y']='T';
key['U']='Y';
key['I']='U';
key['O']='I';
key['P']='O';
key['[']='P';
key[']']='[';
key[92]=']';
key['S']='A';
key['D']='S';
key['F']='D';
key['G']='F';
key['H']='G';
key['J']='H';
key['K']='J';
key['L']='K';
key[';']='L';
key[39]=';';
key['X']='Z';
key['C']='X';
key['V']='C';
key['B']='V';
key['N']='B';
key['M']='N';
key[',']='M';
key['.']=',';
key['/']='.';
key[32]=' ';
while(gets(str))
{
i=0;
while(str[i])
{ if((str[i]>='0')&&(str[i]<='9'))
{
str[i]=str[i]-48;
printf("%c",key[str[i++]]);
}
else if((str[i]!='Q')||(str[i]!='A')||(str[i]!='Z')||(str[i]!='`'))
printf("%c",key[str[i++]]);
}
printf("\n");
}
return 0;
}
No comments:
Post a Comment