怎么用c语言编写判断大小写字母并把小写改为大写并输出的程序。

2025-04-16 03:24:19
推荐回答(1个)
回答(1):

#include 
int main(){
    char temp;
    scanf("%c",&temp);
    if (temp >= 'a' && temp <= 'z') {
        printf("你输入的是小写字母:%c,转换为大写字母为:%c\n", temp, temp-32);
    }
    else printf("你输入的是大写字母:%c\n",temp);
    return 0;
}