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

Simple Incrementing Problem

Name: Anonymous 2014-03-04 22:59

I don't know exactly what to do in this problem. It seems maddeningly simple, but I'm at a loss.

I want to find all of the multiples of 3 and 5 that are less than 1000, then find their sum.

I've got this:

while (x < 999 && y < 1000):
{
    x += 3;
    y += 5;
}

Where/how can I calculate the sum?

Name: Anonymous 2014-03-06 5:13

Can't people oneliner?

int i,sum=0;
for(i=0;i<1000;i++)if(i%15==0)sum+=i;

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