C语言程序设计第三版苏小红习题5.8输入一个字符判断是数字、大写字母、小写字母、空格、还是其他

#include<stdio.h>
int main()
{
char ch;
printf(“输入一个字符:\n”);
ch=getchar();
if(ch>=‘a’ || ch<=‘z’)
printf("%c\n",ch);
else if(ch>=‘A’ || ch<=‘Z’)
printf("%c\n",ch);
else if(ch=’ ')
printf("%c\n",ch);
else
printf(“other!\n”);
return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43462140/article/details/91128503