Starting Euler 1: done python, ruby and lisp, working on erlang
This commit is contained in:
commit
f2cd84cffc
|
@ -0,0 +1,5 @@
|
|||
(let ((sum 0))
|
||||
(loop for i from 2 to 999 do
|
||||
(if (or (eql (mod i 3) 0) (eql (mod i 5) 0))
|
||||
(incf sum i)))
|
||||
(format t "~d~%" sum))
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
sum = 0
|
||||
for i in range(2,1000):
|
||||
if i % 3 == 0 or i % 5 ==0 :
|
||||
sum += i
|
||||
|
||||
print sum
|
Loading…
Reference in New Issue