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这题用递归会溢出