package com.qx.pta; public class PtaOneUtil { /** * 1.求N的阶乘 * 2.求(N-M)的阶乘 */ public static double N(double N) { if (N == 1 || N == 0) { return 1; } else { return N * N(N - 1);//运用了递归的思想 } } }