Engineering & Technology
大学生・専門学校生・社会人
請問有沒有大神會翻成程式碼?
我看不懂
Sieve algorithm
1.1 What Is an Algorithm?
33
for p 2 to n do A[p] - P
for p < 2 to [n] do //see note before pseudocode
if A[p]+0 llp hasn't been eliminated on previous passes
jr p * P
while j < n do
A[j]0 //mark element as eliminated
j<j+ p
I/copy the remaining elements of A to array L of the primes
if( 0
for p + 2 to n do
if A[p] = 0
L[i] + A[p]
iki +1
return L
回答
まだ回答がありません。
疑問は解決しましたか?
この質問を見ている人は
こちらの質問も見ています😉
おすすめノート
計算機程式-Part 1
107
0
計算機程式-Part 3
57
0
計算機程式-Part 2
57
0
R程式語言
54
1
計算機程式-Part 4
53
0
電路學EP.02 電路分析方法
46
0
Python初學筆記
46
0