1
0
mirror of https://github.com/krislamo/knrc.git synced 2025-09-11 16:39:28 +00:00

Exercise 1-12. one word per line

This commit is contained in:
2021-11-13 00:30:40 -05:00
parent 0c2d0fae2b
commit 0cc240323a

14
10-one-word-per-line.c Normal file
View File

@@ -0,0 +1,14 @@
#include <stdio.h>
int main()
{
int c;
while((c = getchar()) != EOF) {
if (c == ' ' || c == '\n' || c == '\t')
printf("\n");
else
printf("%c", c);
}
}