斐波那契数列

来源:互联网 发布:制作投票软件 编辑:程序博客网 时间:2024/06/05 14:23


斐波那契数列

public static void main(String[] args) throws Exception {        System.out.print(f(1,1,5) + "、");}public static long f(long a, long b, long n) {        if (n > 2) {            return f(a + b, a, n - 1);        }        return a;}


原创粉丝点击