https://pintia.cn/problem-sets/12/problems/356
1 int f(int n) 2 { 3 int ret; 4 5 if (n == 0) 6 { 7 ret = 0; 8 } 9 else if (n == 1) 10 { 11 ret = 1; 12 } 13 else 14 { 15 ret = f(n - 1) + f(n - 2); 16 } 17 18 return ret; 19 }
原文地址:https://www.cnblogs.com/2018jason/p/12233446.html
时间: 2024-10-08 03:55:42