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

recursive sentence reverse [C]

Name: Anonymous 2013-08-14 20:16

how is my solution, /prog/-kun?

void
putwd(char *s)
{
        while (*s && !isspace(*s))
                putchar(*s++);
        putchar(' ');
}

char *
cdr(char *s)
{
        while (*s && !isspace(*s))
                ++s;
        while (isspace(*s))
                ++s;
        return *s ? s : NULL;
}

void
rprint(char *s)
{
        if (cdr(s))
                rprint(cdr(s));
        putwd(s);
}

int
main(void)
{
        rprint("anus my hax");
        putchar('\n');
        return 0;
}

Name: Anonymous 2013-08-15 8:08

>>18
Hi LAC welcome back!

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