2011年11月21日星期一

CoffeeScript中的Sieve of Eratosthenes

短短的一行 (n) -> (p.push i for i in [2..n] when !(p or p=[]).some((j) -> i%j is 0)) and n in p

沒有留言:

發佈留言