递归调用

package basis;

public class series {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println(method(5));
    }
    
    public static int method(int i){
        if(i==1) return 1;
        else  return i*method(i-1);
    }

}

 

转载于:https://www.cnblogs.com/tsinghuaxiaobao/p/5726288.html

你可能感兴趣的:(递归调用)