1 2 3 4 5 6 7 8 9 10
#include "sieve.hh" #include <cmath> [[nodiscard]] bool isPrime(std::size_t x) { for (size_t i = 2; i <= sqrt(x); ++i) if (x % i == 0) { return false; } return true; }