一个c语言的问题
#include "stdio.h"
main()
{
int letter=0,space=0,number=0,others=0;
char a;
while(a=getchar()!='\n')
{
if((a>=65&&a<=90)||(a>=97&&a<=122))
{
letter++;
}
else if(a>=48&&a<=57)
{
number++;
}
else if(a==59)
{
space++;
}
else
others++;
}
printf("there are %d letter\n",letter);
printf("there are %d space\n",space);
printf("there are %d number\n",number);
printf("there are %d others\n",others);
}
我本想把输入的字符分类统计出来,可为什么全都加到others上去了