c语言水题,在大学里,很多单词都是一词多义,偶尔在文章里还要用引申义.这困扰Redraiment很长的时间.他开始搜集那些单词的所有意义.他发现了一些规律,例如“a”能用“e”来代替,“c”能用“f”来代替……现在他给出了字母的替换规则,如下所示,A被E替换,B被C替换,依次类推.A B C D E F G H I J K L M N O P Q R S T U V W X Y ZE C F A J K L B D G H I V W Z Y M N O P Q R S T U Xa b c d e f
2019-05-23
c语言水题,
在大学里,很多单词都是一词多义,偶尔在文章里还要用引申义.这困扰Redraiment很长的时间.
他开始搜集那些单词的所有意义.他发现了一些规律,例如
“a”能用“e”来代替,“c”能用“f”来代替……
现在他给出了字母的替换规则,如下所示,A被E替换,B被C替换,依次类推.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
E C F A J K L B D G H I V W Z Y M N O P Q R S T U X
a b c d e f g h i j k l m n o p q r s t u v w x y z
e r w q t y g h b n u i o p s j k d l f a z x c v m
输入:本题包括多组测试数据.
每组测试数据为一行:为仅由字母和空格组成的字符串(空格不变).
输入以单行“#”结束.
输出:
对应每组测试数据,替换后输出它的引申义.
样例输入:Ilttabaje zaujljg
#
样例输出:Different meaning
#include
#include
char a[52][2]={{'A','E'},{'B','C'},{'C','F'},{'D','A'},{'E' ,'J'},{'F','K'},{'G','L'},
{'H' ,'B'},{'I','D'},{'J','G'},{'K','H'},{'L','I'},{'M','V'},{'N','W'},{'O','Z'},
{'P','Y'},{'Q','M'},{'R','N'},{'S','O'},{'T','P'} ,{'U','Q'},{'V','R'},{'W','S'},{'X','T'},{'Y','U'},
{'Z','X'},
{'a','e'},{'b','r'},{'c','w'},{'d','q'},{'e','t'},{'f','y'},{'g','g'},{'h','h'},
{'i','b'},{'j','n'},{'k','u'},{'l','i'},{'m','o'},{'n','p'},{'o','s'},{'p','j'},{'q','k'},{'r','d'},
{'s','l'},{'t','f'},{'u','a'},{'v','z'},{'w','x'},{'x','c'},{'y','v'},{'z','m'}};
main()
{
char b[10000],len;
while(scanf("%c",&b[0]),b[0]!='#')
{
int i,j;
for(i=1;;i++)
{
scanf("%c",&b[i]);
if(b[i]=='')
{
b[i]='\0';
break;
}
}
len=strlen(b);
for(i=0;i