Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
203 B
1
Indexable
Never
inline bool isPrime(int n) {
    if (n <= 1) {
        return false;
    }
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) {
            return false;
        }
    }
    return true;
}