斐波那契数列:1, 1, 2, 3, 5, 8, 13,...,即 f(n) = f(n-1) + f(n-2). 求第n个数的值. 方法一:迭代 public static int iterativeFibonacci(int n) { //简单迭代 int a = 1, b = 1; for(int i = 2; i < n; i ++) { int tmp = a + b; a = b; b = tmp; } return b; } 方法二:简单递归 public static long…