为什么出不来结果呢,不知道哪里出错了
程序代码:/* Note:Your choice is C IDE */
#include "stdio.h"
void main()
{
char ch;
int alph=0,digit=0,empty=0,other=0;
printf("输入一行字符:");
ch=getchar();
while(ch!='\n')
{
if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z')
alph++;
else if(ch>='0'&&ch<='9')
digit++;
else if (ch==' ')
empty++;
else other++;
}
printf("字母的个数为%d\n",alph);
printf("数字的个数为%d\n",digit);
printf("空格数为%d\n",empty);
printf("其他字符的个数为%d\n",other);
}运行上面的程序,却出不来结果不知道是什么原因






