All pastes #361143 Raw Edit

Something

public text v1 · immutable
·published 2007-02-17 23:16 UTC
rendered paste body
/* Takes input, and puts one word per line as output */
#include <stdio.h>

#define IN 1
#define OUT 0

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