diff --git a/e0001/euler0001.hs b/e0001/euler0001.hs new file mode 100644 index 0000000..9f7247a --- /dev/null +++ b/e0001/euler0001.hs @@ -0,0 +1,5 @@ +main :: IO() +main = do + print (sum multiples) + where + multiples = [x | x <- [3..999], (mod x 3 == 0) || (mod x 5 == 0)] diff --git a/e0002/euler0002.hs b/e0002/euler0002.hs new file mode 100644 index 0000000..16bac15 --- /dev/null +++ b/e0002/euler0002.hs @@ -0,0 +1,6 @@ +main :: IO() +main = do + print (sum ret) + where + fibs = 1 : 2 : zipWith (+) fibs (tail fibs) + ret = filter even (takeWhile (<= 4000000) fibs)