Can you imagine find wakeless,like a satellite,in the black sky?
Somewhere,like a star.
We dream about things way beyond this atmosphere.
At we're now,on the air.
……
But I eventually evaporates in a blackhole…
Will I just stick up there?……
给定以下程序中的 (即输入),求以下伪代码的输出结果。
Input n
For i := 1 to n
is_not_prime[i] := 0
cntp := 0
counter := 0
For i := 2 to n {
If is_not_prime[i] = 0 {
cntp := cntp + 1
primes[cntp] := i
}
For j := 1 to cntp {
If i * primes[j] > n
break
is_not_prime[i * primes[j]] := 1
If i Mod primes[j] > 0 // should be `If i Mod primes[j] = 0` in Sieve of Euler
break
counter := counter + 1
}
}
Print cntp, counter