Source

euler / haskell / 01-sum-numbers.hs

1
2
3
4
5
6
7
8
9
--
-- 01-sum-numbers.hs
--
-- Sum all the numbers in the range [1,1000). 
--

sumNumbers = sum [i | i <- [1..999], i `mod` 3 == 0 || i `mod` 5 == 0]

main = do putStrLn (show sumNumbers)