1 public class DiGui { 2 public static void main(String[] args) { 3 DiGui diGui = new DiGui(); 4 System.out.println(diGui.multiply(10)); 5 public int multiply(int sum){ 6 if(sum==1){ 7 return 1; 8 }else{ 9 return sum * multiply(sum-1); //循环n*(n-1) 10 } 11 }