首页 > 试题广场 >

编写一个程序,输入一个字母,若为大写字母,将其转换成小写字母

[问答题]
编写一个程序,输入一个字母,若为大写字母,将其转换成小写字母后输出,否则原样输出。

推荐
#include <stdio.h>
void main()
{
    char ch;
    printf("ch");
    scanf("%c",&ch);
    if(ch>='A' && ch<='Z')
        ch=ch+32;
    printf("%c\n",ch);
}

发表于 2018-05-06 21:50:50 回复(0)