我不清楚我的这个特殊字符和空格统计的为啥不对啊 我的特殊字符怎么全加到空格里了 求解
#include<stdio.h>
int main ()
{
char str[3][80];
int i,j=0;
int low=0,up=0,space=0,digit=0,other=0;
for(i=0;i<3;i++)
{
printf("第%d行:",i+1);
gets(str[i]);
j=0;
while(str[i][j]!='\0')
{
if(str[i][j]>='A'&&str[i][j]<='Z')
up++;
else if(str[i][j]>='a'&&str[i][j]<='z')
low++;
else if(str[i][j]>='0'&&str[i][j]<='9')
digit++;
else if (str[i][j]=' ')
space++;
else
other++;
j++;
}
}
printf("大写字母:%d\n小写字母:%d\n数字:%d\n空格:%d\n其他:%d\n",up,low,digit,space,other);
return 0;
}