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

Project Euler

Name: Anonymous 2010-09-24 23:18

Hey /prog/, I know I'm a little late to the party, but I was wondering how many problems you've solved thus far.
Other discussion regarding Project Euler is also welcome!

Name: Anonymous 2010-09-24 23:35

Impromptu challenge proposal:

Solve a P.U. problem of your choice.

If the chosen problem has been solved previously in the thread, your solution must exceed all previous solutions in one or more aspects of: correctness, clarity, conciseness, elimination of redundant calculation.

Name: Anonymous 2010-09-25 13:53

>>2
1st Problem


#include <stdio.h>

main()
{
    float answer = 0;
    int i = 1;
   
    while (i < 1000)
    {
        labelA:
        if ((i%15) == 0)
        {answer+=i;
        i++;
        goto labelA;}
        if ((i%5) == 0)
        {answer+=i;}
        if ((i%3) == 0)
        {answer+=i;}
        i++;
    }
    printf("%f", answer);
    return 0;
}

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