Home > Back-end >  Strives for the programming process
Strives for the programming process

Time:09-17

Write a encryption function implementation by any keyboard input a string of words
Operator, carries on the encryption,
Encryption principle is: if the capital letters, it according to the English word
Mother order cycle moves to the right of 10 letters, and converted into minuscule
Mother
If it is lowercase letters, its cycle according to the English alphabet right
12 letters, and converted to uppercase letters
If for the digital, according to the Numbers 0 to 9 circulation left 6; The
His character remains the same,

CodePudding user response:

Written in c language needs

CodePudding user response:

 # include & lt; Stdio. H> 
Int main (int arg c, char * * argv)
{
char ch;
While ((ch=getchar ())! )='\ n' {
If (' A '& lt;=ch & amp; & Ch<='Z') {//deal with capital letters
Putchar (ch - 'A' + 10) % 26 + 'A');
} else if (' a '& lt;=ch & amp; & Ch<='z') {//processing lowercase
Putchar (ch - 'a' + 12) % 26 + 'a');
} else if (' 0 '& lt;=ch & amp; & Ch<='9') {//processing digital
Putchar (((ch - '0' - 4) % 10 + 10) % 10 + '0');
} else {//processing other characters
Putchar (ch);
}
}
return 0;
}

Please take a look at this program whether meet the requirements,
  • Related