题解 | #字母大小写转换#
字母大小写转换
https://www.nowcoder.com/practice/850ebd30a2a34cfc87199da3fc15786a
#include <stdio.h> #include <ctype.h> int main() { char ch = 'a'; while (~scanf(" %c", &ch)) { //判断是不是大写字母 if (isupper(ch)) { //转小写 printf("%c\n",tolower(ch)); }else if(islower(ch)) { //转大写 printf("%c\n",toupper(ch)); } } return 0; }