int fun1(char a1[80]) {
int i = 0, c = 0, k = 0, d = 0;
while (a1[i] != '\0') {
if (a1[i] >= 'a' && a1[i] <= 'z' || a1[i] >= 'A' && a1[i] <= 'Z')
c++;
else if (a1[i] == ' ')
k++;
else if (a1[i] != ' ' && (a1[i + 1] == ' ' || a1[i + 1] == '\0'))
d++;
i++;
}
printf("c=%d k=%d d=%d\n", c, k, d);
return 0;
}
这个函数c是字母个数 k是空格个数 d是单词个数,接着输入一串字符,输出之后为什么单词个数一直是0呢,是哪里错了吗