How Many Combinations?
Submit solution
Points:
40 (partial)
Time limit:
1.0s
Memory limit:
256M
Authors:
Problem types
Allowed languages
Java 19, Java 8
題目說明
請設計一程式,計算n取x有幾種組合
\(C_{x}^{n}={\frac {n!}{(n-x)!x!}}\)
輸入
兩正整數(分別為n、x,且n>=x
)
// n、x皆不大於15
// 若考量階乘數字過大,可使用long
宣告變數
輸出
有幾種組合
測試資料 輸入
5 3
測試資料 輸出
10
Comments
題解