二叉树(三)

来源:互联网 发布:轻量 linux 桌面 编辑:程序博客网 时间:2024/04/25 21:51
package cn.jbit.nodetree.test;public class Test2 {    public static void main(String[] args) {        // 5*4*3*2*1        //  6*5*4*3*2*1        int m = test(6);        System.out.println(m);    }    public static int test(int n){        if(n == 1){            return 1;        }else{            return n*test(n-1);        }    }}
0 0