Created
December 29, 2022 14:48
-
-
Save MAGANER/6ab1f6ffc485738be90945920d420923 to your computer and use it in GitHub Desktop.
first task solution from https://projecteuler.net in haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
#1 task from https://projecteuler.net/archives | |
Find the sum of all the multiples of 3 or 5 below 1000. | |
-} | |
mult::Int -> Bool | |
mult x = x `mod` 5 == 0 || x `mod` 3 == 0 | |
filter_seq::[Int] -> [Int] | |
filter_seq seq = [x | x <- seq, mult x ] | |
main::IO() | |
main = print (sum $ filter_seq [0..999]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment