about summary refs log tree commit diff stats
path: root/1.5.c
blob: 3bb16adc08605779fc008196a00f47de2a4eb525 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}