题解 | #斐波那契数列#

斐波那契数列

http://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3

递归

public class Solution {
    public int Fibonacci(int n) {
        if(n==1){
            return 1;
        }
        if(n==2){
            return 1;
        }
        return Fibonacci(n-1) + Fibonacci(n-2);
    }
}
全部评论

相关推荐

想玩飞盘的菠萝蜜在春...:上交✌🏻也拒?
点赞 评论 收藏
分享
派派Emma:公司是在缅北吗
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务