zhang_yan6

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

package demo;

 

public class Demo {

    public static void main(String[] args) {

       int jc = getJc(5);

       System.out.println(jc);

    }

    public static int getJc(int num){

       int result = 1;

       if(num > 1){

           result = num * getJc(num -1);

       }

       return result;

    }

      

   

posted on 2018-11-23 16:23  zhang_yan6  阅读(1344)  评论(0编辑  收藏  举报