mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fixed cpplint long -> int64
This commit is contained in:
parent
c344d8f6f1
commit
fa92a18c2e
@ -14,9 +14,9 @@ void Sieve(int64_t n) {
|
||||
memset(prime, '1', sizeof(prime)); // intitize '1' to every index
|
||||
prime[0] = '0'; // 0 is not prime
|
||||
prime[1] = '0'; // 1 is not prime
|
||||
for (long p = 2; p * p <= n; p++) {
|
||||
for (int64 p = 2; p * p <= n; p++) {
|
||||
if (prime[p] == '1') {
|
||||
for (long i = p * p; i <= n; i += p)
|
||||
for (int64 i = p * p; i <= n; i += p)
|
||||
prime[i] = '0'; // set all multiples of p to false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user