Stuff
public text v1 · immutable#include <stdio.h>
int main (void)
{
int c, chars, lines, words, state;
chars = words =lines = state = 0;
while (++chars && ((c = getchar ()) !=EOF))
{
if ((c == '\n' && ++lines) || c == ' ' || c == '\t')
state = 0;
else if (!state && ++words)
state = 1;
}
printf ("Words %d, New lines %d, Characters %d\n", words, lines, chars);
return 0;
}