本文介绍了关于密码问题的一行代码无法理解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计们!



我真的不知道这个!



ac program!



密码提问:将字母A转为字母E,a至e,即进入以下第四个字母,将W转为A,X转为B,Y转入C,Z为D.例如:将China转移到Glmre。



程序如下:

hi guys!

I really don't konw this!

a c program!

Password question: turn the letter A into letter E, a to e, namely into the fourth letter of the following, turn the W into A, X into B, Y into C, Z into D. For example: the transfer "China" to "Glmre".

Procedure is as follows:

#include<stdio.h>
void main()
{
   char c;
   while((c=getchar())!='\n')
           {
              if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))

                  {

                      c=c+4;

                       if(c>'Z'&&c<='Z'+4||c>'z')
                            c=c-26;
                   }
               printf("%c",c);
            }
     printf("\n");
}

my question is:In the first ten lines of code, why the processing of lowercase letters without written c > 'z' && c < = 'z' + 4, but just write c > 'z'?

hope you can help me!thank you

推荐答案


这篇关于关于密码问题的一行代码无法理解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 19:45