haskell solutions for 1 and 2
This commit is contained in:
parent
73b494e207
commit
2717476a96
2 changed files with 11 additions and 0 deletions
6
e0002/euler0002.hs
Normal file
6
e0002/euler0002.hs
Normal file
|
@ -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)
|
Reference in a new issue