C语言填空:判断字符是数字还是小写字母或大写字母或其他字符

#include<stdio.h>
//判断指定字符是数字还是小写字母或大写字母或其他字符 
main()
{【1】 ch;
printf("请输入一个字符");
scanf("【1】",【1】);
if(【1】)
  printf("%c是大写字母",ch);
else if(【1】)
        printf("%c是小写字母",ch);
     else if(【1】)
         printf("%c是数字",ch);
         else printf("%c是其他字符",ch); 

}
#include<stdio.h>
//判断指定字符是数字还是小写字母或大写字母或其他字符 
main()
{char ch;
printf("请输入一个字符");
scanf("%c",&ch);
if(ch>='A'&&ch<='Z')
  printf("%c是大写字母",ch);
else if(ch>='a'&&ch<='z')
        printf("%c是小写字母",ch);
     else if(ch>='0' && ch<='9')
        printf("%c是数字",ch);
        else printf("%c是其他字符",ch); 

}

 

posted @ 2023-02-08 15:49  myrj  阅读(741)  评论(0编辑  收藏  举报