#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch;
printf("请输入一个字符ch:");
scanf("%c",&ch);
if(ch>=65&&ch<=90)
{
printf("该字符是大写字母\n");
printf("ch=%c\n",ch);
}
else if(ch>=97&&ch<=122)
{
printf("该字符是小写字母\n");
printf("ch=%c\n",ch);
}
else if(ch>=48&&ch<=57)
{
printf("该字符是数字字符\n");
printf("ch=%c\n",ch);
}
else if(ch==32)
{
printf("该字符是空格\n");
}
else
{
printf("该字符是其他字符\n");
}
printf("%c\n",ch);
return 0;
}
学习心得:知识点:字符的使用 ASII码的使用