1. cctype里的isalnum()放字母就返回ture,而isalpha()里放char时是字母就返回ture放string时要求是全是字母才返回ture,isalnum可以参杂数字。判断数字函数isdigit()
2.大小写转换函数tosupper() tolower()
3. 连续输入并转换大小写,@结束。
#include#include #include #include #include #include using namespace std; int main() { char ch; while (cin.get(ch)) { if (ch == '@') { break; } if (islower(ch)) { ch = toupper(ch); } else { ch = tolower(ch); } cout << ch; } }



