注册 登录
编程论坛 C++教室

字母转化

雨后的清晨 发布于 2012-11-12 20:09, 250 次点击
#include<iostream.h>
#include<conio.h>
void main()
{
    char ch;
    cin>>ch;
    if((ch<='z')&&(ch>='a'))
    {
        ch=ch-32;
        cout<<ch<<endl;
    }
    else
    {
        if((ch<='Z')&&(ch>='A'))
        {
            ch=ch+32;
            cout<<ch<<endl;
        }
        else
        {
            cout<<ch<<endl;
        }
    }
    getch();
}
2 回复
#2
yuccn2012-11-12 21:14
有什么问题?
#3
小小小火柴2012-11-12 22:42
   楼主想问什么 ?就是字母大小写转化啊
1