From 39c0cbcc70aff47e17107826aa76cb525c83b122 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 9 Jul 2019 16:00:48 -0400 Subject: ch2 --- word_hist.c | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 word_hist.c (limited to 'word_hist.c') diff --git a/word_hist.c b/word_hist.c deleted file mode 100644 index 965c1b9..0000000 --- a/word_hist.c +++ /dev/null @@ -1,24 +0,0 @@ -#include - -/* - * Prints a histogram of the lengths of words in its input. - */ -main() { - int c; - int count; - - while ((c = getchar()) != EOF) { - if (c == '\n' || c == '\t' || c == ' ') { - - while (count > 0) { - printf("%s", "*"); - --count; - } - - if (count > 0) { - printf("\n"); - } - } else - ++count; - } -} -- cgit v1.2.3