char c = getchar();if(c <= 'Z' && c >= 'A') { c += 32;}else if (c <='z' && c >= 'a') {ch -= 32; }32是大小写字母在ascii码表上的位置差,小写比大写高32
输入char ch;if(ch <= 'Z' && ch >= 'A') ch = ch - 'A' + 'a';else if(ch <='z' && ch >= 'a') ch = ch - 'a' + 'A';