📜  n*n 的前 k 位 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:14.409000             🧑  作者: Mango

代码示例1
factor = n mod 10^k
result = 1
while (n != 0) 
    if (n is odd) then result = (result * factor) mod 10^k
    factor = (factor * factor) mod 10^k
    n >>= 1