注意只能使单个字母大小写转换
1.库函数:toupper和tolower函数
形参和返回值都是int,因此采用char传值和接收来隐式转换为char。
char s = 'a';
cout << (char)toupper(s) << '\n';
char s = 'A';
cout << (char)tolower(s) << '\n';
2.ASCII:+32和-32
+32:小写变大写
char s = 'A';
cout << (char)(s + 32)<< '\n';
-32:大写变小写
char s = 'a';
cout << (char)(s - 32)<< '\n';