luohzzz

导航

递归

递归

package ff;

public class Dome6 {
   public static void main(String[] args) {
       System.out.println(f(4));
  }
   public static int f(int n){
       if (n==1);
       return 1;
  }
   else {
       return n*f(n-1);
  }
}

 

posted on 2021-04-24 22:33  luohzzz  阅读(32)  评论(0编辑  收藏  举报