摘要: Problem 10The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.开始的思路是逐个数做素性判断,然后做成素数表或直接累加。View Code import timedef pe010BF(n): t1 = time.time() sumOfPrime = 2 for k in range(3, n, 2): isPrime = True for i in range(3, int(k**1/2... 阅读全文
posted @ 2012-12-05 22:01 river_run 阅读(273) 评论(0) 推荐(0) 编辑