Digit fifth powers: Difference between revisions
→{{header|C++}}: exchanged autos for ints
(Added C++ (fast) version) |
(→{{header|C++}}: exchanged autos for ints) |
||
Line 246:
=={{header|C++}}==
Fast version. Checks numbers up to 399,999, which is above the requirement of 6 * 9<sup>5</sup> and well below the overkill value of 999,999.
<lang cpp>#include <iostream>
#include <cmath>
Line 256:
int nums[] = { 0,1,2,3,4,5,6,7,8,9 }, nu[] = { 0,1,2,3 },
p5[10], t = 0;
for (
for (
for (
for (
if (nm == mp + p5[n] && nm > 1) t += nm; } } } } } }
auto et = steady_clock::now();
|