public class Demo05 { public static void main(String[] args) { //打印5 的阶乘 System.out.println(f(5)); } public static int f(int n){ if(n==1){ return 1; }else{ return n*f(n-1); } } }
标签:06,Java,递归,int,static,return,public From: https://www.cnblogs.com/sankouyitouju/p/17837193.html