P(n,r) = n! / (n−r)!

Compute the number of permutations P(n, k) without repetition.

📐 計算公式
排列數與組合數(本頁程式碼口徑):排列數 P(n,r)=n×(n−1)×…×(n−r+1);組合數 C(n,r)=P(n,r)÷r!;r!=1×2×…×r。校驗:n、r 必須是非負整數且各自 ≤10000;r>n 直接報錯,不自動鉗制;P、C、r! 均用 BigInt 精確整數計算。判據:無固定分級,輸出按千分位顯示精確整數,n=r 時 P=n!、C=1。

從 n 個元素取 r 個的排列數。

📌 計算說明
  • P(10,3) = 720。
  • 與順序有關。