浏览代码

Create a function to list the dividers of a number

DricomDragon 5 年之前
父节点
当前提交
2c73d8afb1
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      prime.hs

+ 4 - 0
prime.hs

@@ -0,0 +1,4 @@
+-- Exercice from slide 42/82
+
+dividers n = [k | k <- [2..(n-1)], rem n k == 0]
+