Enter a letter if lowercase letters, the uppercase output, otherwise, is output.

# include<stdio.h>
int main()
{
	char ch;
	scanf("%c",&ch);
	((ch>='a')&&(ch)<='z')?(ch=ch+'A'-'a'):ch;
	printf("%c",ch);
	return 0;
}

For the case of conversion processes have many common if statements, switch statements like sorting process to achieve the desired objectives.

Published 43 original articles · won praise 1 · views 822

Guess you like

Origin blog.csdn.net/Du798566/article/details/104185010