added old solutions
This commit is contained in:
parent
3a4827b082
commit
a373abfdf1
14 changed files with 153 additions and 0 deletions
2
hs/1.hs
Normal file
2
hs/1.hs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
main = do
|
||||
putStrLn (show (sum [x | x <- [1..999], x `mod` 3 == 0 || x `mod` 5 == 0]))
|
||||
6
hs/5.hs
Normal file
6
hs/5.hs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
divisible x y = x `mod` y == 0
|
||||
|
||||
smallest x = if all (divisible x) [2..20] then x else smallest (succ x)
|
||||
|
||||
main = do
|
||||
print(smallest 1)
|
||||
2
hs/6.hs
Normal file
2
hs/6.hs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
main = do
|
||||
print (sum [1..100] ^ 2 - sum [x ^ 2 | x <- [1..100]])
|
||||
Loading…
Add table
Add a link
Reference in a new issue