这里格式不知道有啥问题了,但结果正确
#include <stdio.h>
#include <string.h>
int main()
{ //printf("%d %d",'d','^');//65 97
char s[10];
gets(s);
for(int i=0;i<strlen(s);i++)
{
if((s[i]>='A'&&s[i]<='V')||(s[i]>='a'&&s[i]<='v'))
s[i]=s[i]+4;
else if((s[i]>='W'&&s[i]<='Z')||(s[i]>='w'&&s[i]<='z'))
s[i]=s[i]-22;//26个英文字母,在‘Z’和‘a’之间还有6个其他字符
}
printf("%s",s);
}