斐波拉契数列是指这样一个数列: F(1)=1; F(2)=1; F(n)=F(n-1)+F(n); 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 +…