Summation of primes
Problem 10
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
本文介绍了一种计算200万以内所有质数之和的方法,并给出了完整的C语言实现代码。通过一个简单的质数判断函数配合循环累加,最终得出质数之和为142913828922。
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
535
1610

被折叠的 条评论
为什么被折叠?