题解 | #斐波那契数列#
斐波那契数列
https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3
class Solution { public: int Fibonacci(int n) { int a=1,b=0,c=0; for(int i=0;i<n;i++) { c=a+b; a=b; b=c; } return c; } };
斐波那契数列
https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3
class Solution { public: int Fibonacci(int n) { int a=1,b=0,c=0; for(int i=0;i<n;i++) { c=a+b; a=b; b=c; } return c; } };
相关推荐