Skip to content

Commit

Permalink
euler 1
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Mar 26, 2011
1 parent 15243c9 commit ccc6348
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions euler001.hs
@@ -0,0 +1,14 @@

module Main where

import System.IO

sum3_5 0 = 0
sum3_5 n
| n `mod` 3 == 0 = n + sum3_5(n-1)
| n `mod` 5 == 0 = n + sum3_5(n-1)
| otherwise = sum3_5(n-1)

main :: IO()
main = do
print (sum3_5 999)

0 comments on commit ccc6348

Please sign in to comment.