Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How does this work?

Name: Anonymous 2013-02-05 12:28


#include <stdio.h>

int main ()
{
    int c, d;

    d = EOF;

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

Name: Anonymous 2013-02-05 13:00

>>1
Here's an idea:

#include <stdio.h>
int main(void) { int c; while ((c = getchar()) != EOF) putchar(c); return 0; }


It does the same thing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List