#include<iostream>
#include<cctype>
using namespace std;
int main(){
char str='0';
cin>>str;
if(isupper(str))
cout<<"The source key is: "<<str<<",after converting is: "<<static_cast<char>(tolower(str))<<endl;
else if(islower(str))
cout<<"The source key is: "<<str<<",after converting is: "<<static_cast<char>(toupper(str))<<endl;
else if(isdigit(str))
cout<<"The source key is: "<<str<<",after converting is: "<<hex<<str<<endl;
else
cout<<"Control
key";
system("pause");
return 0;
}
输出toupper(str)时为什么是int型的
还必须得强制转换啊