标签:style The sof color font 现在 ++ span soft
n<=39
public class Solution {
public int Fibonacci(int n) {
int preNum = 1;
int prePreNum = 0;
int result = 0;
if (n == 0)
return 0;
if (n == 1)
return 1;
for (int i = 2; i <= n; i++) {
result = preNum + prePreNum;
prePreNum = preNum;
preNum = result;
}
return result;
}
}
标签:style The sof color font 现在 ++ span soft
原文地址:https://www.cnblogs.com/MarkLeeBYR/p/9777226.html