public class TestJieCheng { public static void jiecheng(int n) { int result = 1; while(n > 1){ result *= n * (n - 1); n -= 2; } System.out.println("n的阶乘为:" + result); } public static void main(String[] args) { jiecheng(10); } }
欢迎分享,转载请注明来源:内存溢出
public class TestJieCheng { public static void jiecheng(int n) { int result = 1; while(n > 1){ result *= n * (n - 1); n -= 2; } System.out.println("n的阶乘为:" + result); } public static void main(String[] args) { jiecheng(10); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)