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

pls halp

Name: Anonymous 2010-12-10 20:33

what am i doing wrong here
#include <stdio.h>

/* count digits, white space, others */
main()
{
    int c;
    int leaf,rock;

leaf == rock == 0;

    while ((c = getchar()) != EOF)
        if (c == 'l')
            ++leaf;
        else if (c == 'r')
            ++rock;
        else
            printf("leaf:%d\trock:%d\n", leaf, rock);
}


yes, i know, im nothing, im worthless ;_;

Name: Anonymous 2010-12-10 20:46

main()
{
    int c = 0;
    int leaf = 0,rock = 0;

    while ((c = getchar()) != EOF)
        if (c == 'l')
            leaf++;
        else if (c == 'r')
            rock++;
        else
            printf("leaf:%d\trock:%d\n", leaf, rock);
}

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