求助一个简单问题
统计一个字符串中空格,大写字母,小写字母,数字,及其他字符数。#include<stdio.h>
main()
{
char a[100];char *p;
int i,j,k,n,m,s;
p=a;
printf("please enter the letters:\n");
gets(a);
j=0;k=0;m=0;n=0;s=0;
for(i=0;i<100;i++,p++)
{
if(*p==' ')j=j+1;
else{
if('A'<=(*p)<='Z')n=n+1;
else{
if('a'<=(*p)<='z')m=m+1;
else{
if('0'<=(*p)<='9')k=k+1;
else{
if(*p!='\0') s=s+1;
else break;
}
}
}
}
}
printf("The number of space is%d\n",j);
printf("The number of number is%d.\nThe number of capital letters is%d.\nThe number of letters is%d.\nThe number of others is%d\n",k,n,m,s);
getchar();
}那里出错了/ 谢了