求助 怎么跳不出循环??
#include <stdio.h>#include <string.h>
int main()
{
char a[100],c;
int i = 0,sum = 0;
gets(a);
do {
while ( (c = a[i]) == ' ') i++ ;
if (c != '\0') sum++ ;
while ( (c = a[i]) != ' ' && c != '\0 ') i++;
}while (c != '\n') ;
printf ("单词个数为%d",sum);
return 0;
}
高手帮忙看看吧,为什么最后我的编译器跟踪显示的是c = ‘?’啊!!!!