实现效果:
知识运用:
递归算法: return num * factorial(num - 1);
实现代码:
public static double factorial(int num) { switch(num){ case 1: return 1; default: return num * factorial(num - 1); } }
实现效果:
知识运用:
递归算法: return num * factorial(num - 1);
实现代码:
public static double factorial(int num) { switch(num){ case 1: return 1; default: return num * factorial(num - 1); } }