字母加密

1、编程实现对键盘输入的英文名句子进行加密。用加密方法为,当内容为英文字母时其在26字母中的其后三个字母代替该字母,若为其它字符时不变。

#include <stdio.h>
int main()
{
 char c;
 printf("please input a string :");
 while((c=getchar())!='\n')
 {
  if(c>='A' && c<='W' || c>='a' && c<='w')
   c=c+3;
  else
   if(c>='X' && c<='Z' || c>='x' && c<='z')
    c=(c+3)-26;
  printf("%c",c);
 }
 printf("\n");
 return 0;
}

原文地址:https://www.cnblogs.com/newlist/p/2806204.html