Permalink
Browse files

euler 1

  • Loading branch information...
1 parent 15243c9 commit ccc634885c9feaa13f7ff5aba7f5ac5fabcdbb44 @youknowone committed Mar 26, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 euler001.hs
View
@@ -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.