Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

euler 1

  • Loading branch information...
commit ccc634885c9feaa13f7ff5aba7f5ac5fabcdbb44 1 parent 15243c9
@youknowone authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 euler001.hs
View
14 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)
Please sign in to comment.
Something went wrong with that request. Please try again.