FrankKair / polyglot-euler

📜 Project Euler solutions in various programming languages
MIT License
74 stars 14 forks source link

Adding C++ 010 #126

Closed Ernulphus closed 4 years ago

Ernulphus commented 4 years ago

Hello! Thank you for your contribution to polyglot-euler.

How the solution works

The isPrime(x) function checks if the int x has any factors between 1 and itself. If it doesn't, the solve() function will add it to the sum.

Performance

The algorithm tests every number under two million, so it takes a while.

Real time: 60.003 s
User time: 0.352 s
Sys. time: 0.077 s
CPU share: 0.71 %