鱼C论坛

 找回密码
 立即注册
查看: 4080|回复: 12

关于if else语句的问题!

[复制链接]
发表于 2013-11-28 11:21:12 | 显示全部楼层 |阅读模式
3鱼币
#include < stdio.h >
void main()
{
        char c;
        printf("input a character: \n");
        c=getchar();
        if(c<32) printf("this is a control character\n");
        else if(c>='0' && c<='9') printf("This is a digit\n");
        else if(c>='A' && c<='Z') printf("This is a capital letter\n");
        else if(c>='a' && c<='z') printf("This is a small letter\n");
        else printf("This is an other character\n");
       
}
为什么不管输入什么数字,只能显示This is a digit?

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-10-20 03:44

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表