工程與科技 大學 3年以上以前 請問有沒有大神會翻成程式碼? 我看不懂 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 待回答 回答數: 0
工程與科技 大學 4年以上以前 Python 這樣為什麼錯? 輸入兩不同之整數 ,輸出 其大小比較 , 例如:輸入57,輸出5<7,輸出時不 要改變輸入值之順序,不必考慮兩整數 相同之情形。<或 > 前後皆有一隔空格 For example: Input | Result 彈 3<7 同 加 斧寢 天 ~-2 Answer: (penalty regime: 10, 20, ... %) 1 |a=num1 2 「b=num2 3yifa>b: 4|(a>b) 5yleUse 6 prlint (a <b) 待回答 回答數: 0