PCPOTATO
Navigation

Home
About
Contact
Resume

Projects

None yet

Categories

General
Programming

Archives

July 2008
June 2008
May 2008
April 2008
Project Euler #1 April 13th, 2008

The sum of all of the multiples of 3 or 5 below 1000.

1
2
3
4
5
6
7
sum = 0
i = 0
while(i < 1000):
	if(i%5 == 0 or i%3 == 0):
		sum = sum + i
	i = i + 1
print sum

Definitely not the best way to do it, but who am I kidding.

Leave a Reply

You must be logged in to post a comment.

Domains


Links


Presence


Meta

Log in