#includestdio.h#includestring.h#includestdlib.hunsignedi;voidfun(){charstr[256];printf(请输入明文:\n);gets(str);for(i=0;istrlen(str);i++){if(str[i]='a'&&str[i]='z'){str[i]=187-str[i];/*continue;*/}if(str[i]='A'&&str[i]='Z'){str[i]=187-str[i];/*continue;*/}}printf(密文是:\n);puts(str);}voidfun1(){charstr[256];printf(请输入密文:\n);gets(str);for(i=0;istrlen(str);i++){if(str[i]='a'&&str[i]='z'){str[i]=187-str[i];/*continue;*/}if(str[i]='A'&&str[i]='Z'){str[i]=187-str[i];/*continue;*/}}printf(明文是:\n);puts(str);}voidmenu(){charc;printf(\n======字母倒排序======\n);printf(1、进入加密\n2、进入解密\n0、退出\n);printf(\n=====================\n);printf(请选择加密还是解密:\n);scanf(%c,&c);getchar();switch(c){case'1':fun();break;case'2':fun1();break;case'0':exit(0);break;}}intmain(){while(1)menu();return(0);}