求最大素因子,速度太慢了
本帖最后由 李营长 于 2013-03-07 17:16 编辑isPrime :: Integer->Bool
isPrime x = null , x `mod` y == 0]
problem3 =
[ x | x <- 2:, n `mod` x == 0, isPrime x]
where n = 600851475143
haskell没有 100%占用cpu,算起来特别慢:D 李营长 发表于 2013-03-07 16:14 static/image/common/back.gif
isPrime :: Integer->Bool
isPrime x = null
从高到低,用fema小定理
页:
[1]