First 9 prime Fibonacci number: Difference between revisions
Content added Content deleted
Hellangelx (talk | contribs) |
m (Minor edit to C++ code) |
||
Line 445: | Line 445: | ||
<syntaxhighlight lang="cpp">#include <chrono> |
<syntaxhighlight lang="cpp">#include <chrono> |
||
#include <iostream> |
#include <iostream> |
||
#include <sstream> |
|||
#include <utility> |
#include <utility> |
||
#include <primesieve.hpp> |
#include <primesieve.hpp> |
||
Line 497: | Line 496: | ||
std::string to_string(const big_int& n) { |
std::string to_string(const big_int& n) { |
||
std::string str = n.get_str(); |
std::string str = n.get_str(); |
||
size_t len = str.size(); |
|||
if (len > 40) { |
|||
std::ostringstream os; |
|||
str.replace(20, len - 40, "..."); |
|||
str += " ("; |
|||
str += std::to_string(len); |
|||
str += ")"; |
|||
} |
} |
||
return str; |
return str; |