#include <stdio.h>
#include <conio.h>
int main()
{
int word_no[500], j, count_char=0,;
char ch;
for(j=0; j<=10; j++)
{
word_no[j]=0;
}
printf("Enter data. Press \'Esc\' when you complete typing.\n word containing more than 10 character is not included.\n");
j=0;
while(ch!=27)
{
ch=getche();
if(ch==13)
{
printf("\n");
++word_no[count_char];
count_char=0;
j++;
}
if(ch==32 || ch==9 || ch==27)
{
++word_no[count_char];
count_char=0;
j++;
}
if(ch!=32 && ch!=9 && ch!=27 && ch!=13)
{
count_char++;
}
}
printf("\n");
printf("index \t time\n");
for(j=0; j<=10; j++)
{
printf("%d \t %d\n", j, word_no[j]);
}
getch();
}