using namespace std;
void main()
{
char ch,cha;
cout<<"請輸入字符";
cin>>ch;
{
if(ch<='z')
{
cha=ch-32;
cout<<"cha="<<cha<<endl;
}
else
{
cout<<"Begain!"<<endl;
}
}
else
{
if(ch>='A'&&ch<='Z')
{
cha=ch+32;
cout<<"cha="<<cha<<endl;
}
else
{
cout<<"Begain!"<<endl;
}
}
}
輸入一個字符,如果是英文字母,輸入小寫則輸出相對的大寫字母,輸入大寫則輸出相對的小寫字符,輸入其他字符則不能輸出。