1.递归的方法:

private static int Max(int i) {
        if (i<=2) {
            return i;
        }
            return Max(i-1)+Max(i-2);
    }

 

相关文章: