package erase; public class 用递归法求5的阶乘 { public static void main(String[] args) { // TODO Auto-generated method stub int n=5; System.out.print(Digui(5)); } public static int Digui(int n) { if(n==1) { return 1; } else return Digui(n-1)*n; } }
package erase; public class 用递归法求5的阶乘 { public static void main(String[] args) { // TODO Auto-generated method stub int n=5; System.out.print(Digui(5)); } public static int Digui(int n) { if(n==1) { return 1; } else return Digui(n-1)*n; } }