diff options
author | aabacchus <ben@bvnf.space> | 2021-05-19 00:11:26 +0100 |
---|---|---|
committer | aabacchus <ben@bvnf.space> | 2021-05-19 00:11:26 +0100 |
commit | 3a14f3cf7a1bd094ae73a4d2ca151464a9eda224 (patch) | |
tree | 21ca13dd11b0ea7f79feb110b954050b1656bf7a /1.5.c | |
download | kandr-3a14f3cf7a1bd094ae73a4d2ca151464a9eda224.tar.gz |
might as well make commits out of these
Diffstat (limited to '1.5.c')
-rw-r--r-- | 1.5.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/1.5.c b/1.5.c new file mode 100644 index 0000000..3bb16ad --- /dev/null +++ b/1.5.c @@ -0,0 +1,17 @@ +#include <stdio.h> + +int main() { + int c, nb; + char inWord = 0; + while ((c = getchar()) != EOF) { + if (c == ' ' || c == '\n' || c == '\t') { + inWord = 0; + } + else if (inWord == 0) { + putchar('\n'); + inWord = 1; + } + putchar(c); + } + return 0; +} |