[102.2 MID] 1. 排列組合

1.(100%)排列組合
請實作如下3數學方法
public static double factorial(double n)
回傳 n! = n x (n-1) x (n-2) x ... x 1

public static double combination(double n, double m)
回傳 C_n_m = n! / m! / (n-m)!
提示: 呼叫 factorial() 完成

public static double permutation(double n, double m)
回傳 P_n_m = n! / (n-m)!
提示: 呼叫 factorial() 完成

(Sample Output)
factorial(4) = 24.0
factorial(3) = 6.0
factorial(2) = 2.0
factorial(1) = 1.0
factorial(0) = 1.0
combination(4,4) = 1.0
combination(4,3) = 4.0
combination(4,2) = 6.0
combination(4,1) = 4.0
combination(4,0) = 1.0
permutation(4,4) = 24.0
permutation(4,3) = 24.0
permutation(4,2) = 12.0
permutation(4,1) = 4.0
permutation(4,0) = 1.0