MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / isprime

Function isprime

codes/cpp/Code_3_01_1.cpp:1–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1bool isprime(long long N) {
2 // N �� 2 �ȏ�̐����Ƃ��AN ���f���ł���� true�A�f���łȂ���� false ��Ԃ�
3 for (long long i = 2; i <= N - 1; i++) {
4 // N �� i �Ŋ���؂ꂽ�ꍇ�A���̎��_�őf���ł͂Ȃ��ƕ�����
5 if (N % i == 0) return false;
6 }
7 return true;
8}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected