1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-11-10 00:30:35 +00:00

Exercise 1-12. one word per line

This commit is contained in:
Kris Lamoureux 2021-11-13 00:30:40 -05:00
parent 0c2d0fae2b
commit 0cc240323a
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

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);
}
}