wc For The Poor

Write a program that reads from standard input and counts characters, words, and lines. It prints the results on standard output. (Words are separated by one or more spaces, tabulators, or linefeeds.)

Take into account error scenarios and corner cases. For example:

  • What if input strats with a space?

  • What if there are multiple separators between two words?