Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>

#define IN 1
#define OUT 0

int main() {
	char c;
	int wc = 0;
	int state = OUT;
	while ((c = getchar()) != EOF) {
		if (c == ' ' || c == '\n' || c == '\t') {
			if (state == IN) {
				putchar('\n');
			}
			state = OUT;
		}	else {			
			state = IN;
			putchar(c);
		}
	}

	return 0;
}