题解 | #小乐乐走台阶#
小乐乐走台阶
https://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255
#include<stdio.h> long long fib(int n) { if(n==1||n==2) return n; else return fib(n-1) + fib(n-2); } int main() { int n; long long sum=0; scanf("%d",&n); sum=fib(n); printf("%lld",sum); return 0; }
斐波那契数列