无限循环的问题:
我编译下面的程序在Ubuntu 10.04,但它进入一个无限循环中去。请帮我找到了问题。
还告诉EOF是什么......
#include<stdio.h>
void main()
{
int nwords[20];
int count=0, i, c;
for(i=0;i<20;i++)
{
nwords[i]=0;
}
while((c=getchar())!='\n')
{
while((c!=' ')||(c!='\t'))
{
nwords[count]++;
c=getchar();
}
count++;
}
for(i=0;i<20;i++)
{
printf("word no. %d : %d letters", (i+1), nwords[i]);
}
}