这个程序错了?
下面这个程序是统计一个字符串中的数字、字母和其他字符的个数,不过总有错
程序代码:#include<stdio.h>
main()
{
int i,n1=0,nw=0,nc=0;
char c;
char string[10];
gets(string);
for(i=0;c=string[i]!='\0';i++)
{
if((c>='0')&&(c<='9'))
nc++;
else if((c>='a')&&(c<='z'))
n1++;
else nw++;
}
printf("%d %d %d\n",nc,n1,nw);
}








