Home > Back-end >  Consult bosses, title: enter a letter, if it is a capital, converted to lowercase, lowercase ASCLL c
Consult bosses, title: enter a letter, if it is a capital, converted to lowercase, lowercase ASCLL c

Time:01-28

So why can not meet the requirements?

CodePudding user response:

Ch it without '
Repeat the logic judgment, code changes as follows, for reference:
 # include & lt; Stdio. H> 

Int main (int arg c, char * argv [])
{
char ch;
Printf (" input a letter ");
Ch=getchar ();
If (' a '& lt;=ch & amp; & Ch & lt;='z')
{
Ch=ch - 32;
Printf (" \ n % c, % d ", ch, ch);
}
The else
If (' A '& lt;=ch & amp; & Ch & lt;='Z')
{
Ch=ch + 32;
Printf (" \ n % c, % d ", ch, ch);
}
The else
Printf (" % c \ n ", ch);

return 0;
}
  • Related