标签:斐波那契 png inf 技术 mamicode while style 斐波那契数列 fibonacci
class Solution { public: int Fibonacci(int n) { int f=0,g=1; while(n--) { f=f+g; int temp = g; g=f; f = temp; } return f; } };
9这题用递归会溢出
标签:斐波那契 png inf 技术 mamicode while style 斐波那契数列 fibonacci
原文地址:https://www.cnblogs.com/make-big-money/p/12364751.html