summaryrefslogtreecommitdiffstats
path: root/1/12.c
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-11-17 22:46:18 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-11-17 22:46:18 +0800
commitdb556f217693098cd62fb025822f9c55fbc35670 (patch)
treea468beb9a419d9e84a20443d386c916a5a3519db /1/12.c
parent6e65b9e9332426ce359232b4f96b6b36101f4a4d (diff)
downloadk&r-exercises-db556f217693098cd62fb025822f9c55fbc35670.tar.gz
Rename file.
Diffstat (limited to '1/12.c')
-rw-r--r--1/12.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/1/12.c b/1/12.c
new file mode 100644
index 0000000..3ff0898
--- /dev/null
+++ b/1/12.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+/* prints input one word per line */
+int main(int argc, char *argv[]) {
+ int c;
+
+ while ((c = getchar()) != EOF) {
+ if (c == ' ' || c == '\t')
+ putchar('\n');
+ else
+ putchar(c);
+ }
+
+ return 0;
+} \ No newline at end of file