mirror of
https://github.com/krislamo/knrc.git
synced 2025-01-05 19:10:36 +00:00
Exercise 1-12. one word per line
This commit is contained in:
parent
0c2d0fae2b
commit
0cc240323a
14
10-one-word-per-line.c
Normal file
14
10-one-word-per-line.c
Normal 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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user