challenges/e1/e1.ghc.hs

8 lines
189 B
Haskell
Raw Normal View History

2014-08-21 07:19:38 +02:00
import System.IO
sum35 i acc max | i >= max = acc
| rem i 3 == 0 ||rem i 5 == 0 = sum35 (i+1) (acc+i) max
| otherwise = sum35 (i+1) acc max
main = print (sum35 1 0 1000)