#include <stdio.h>
#include <stdbool.h>
#define out false
#define in true
/*Print the number of words, characters and new lines...*/
int main (void)
{
bool state = out;
int chars, lines, words, c;
chars = words =lines = 0;
while ((c = getchar ()) !=EOF)
{
++ chars;
if ( c == '\n')
{
++ lines;
state = out;
}
else if (c == ' ')
state = out;
else if (c == '\t')
state = out;
else if (!state)
{
state =in;
++ words;
}
}
/* print the values...*/
printf ("Words %d, New lines %d, Characters %d\n", words, lines, chars);
return 0;
}