All pastes #802427 Raw Edit

Untitled

public text v1 · immutable
#802427 ·published 2007-11-30 04:25 UTC
rendered paste body
#include <stdio.h>

/* a loop to print every character until EOF  */
main()
{
        int c prevchar;

        while ((c = getchar()) != EOF) {
            if (prevchar != ' ') 
                putchar(c);
            prevchar =c;
        }
}


1-9 write a program to copy input to its output, replacing each string of one or more blanks by a single blank.