输入一个字符判断该字符为数字,大写字母,小写字母,还是其他字符

#include
void main()
{
 char c;
 printf("please input a character/n");
 c=getchar();
    if(c>'0'&&c<'9')
  printf("this is a digital");
    else if(c>'a'&&c<'z')
     printf("this is a small letter ");
         else if(c>'A'&&c<'Z')
    printf("this is  a capital letter");
         else
       printf("this is the others");
}

你可能感兴趣的:(我个人C++成长史)