#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[])
{
char sr[300];
char final[300];
char c;
printf("请输入原文:\n");
int i=0;
while ((c=getchar())!='\n')
{
if ((c<='z')&&(c>='a')||(c<='Z')&&(c>='A'))
{
if (c=='y')
{
final[i]='z';
final[i+1]='a';
final[i+2]='b';
i+=3;
}
else
if (c=='Y')
{
final[i]='Z';
final[i+1]='A';
final[i+2]='B';
i+=3;
}
else
if (c=='z')
{
final[i]='a';
final[i+1]='b';
final[i+2]='c';
i+=3;
}
else
if (c=='Z')
{
final[i]='A';
final[i+1]='B';
final[i+2]='C';
i+=3;
}
else
if (c=='x')
{
final[i]='y';
final[i+1]='z';
final[i+2]='a';
i+=3;
}
else
if (c=='X')
{
final[i]='Y';
final[i+1]='Z';
final[i+2]='A';
i+=3;
}
}
else
{
final[i]=c;
i+=3;
}
final[i]='\0';
printf("%s",final);
return 0;
} |