0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-08 12:18:50 +00:00

21. 斐波那契数列

https://www.acwing.com/problem/content/submission/code_detail/2610805/
This commit is contained in:
Baoshuo Ren 2020-10-10 18:17:00 +08:00
parent f385d08b6d
commit 352faa5ca0
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

9
AcWing/21/21.cpp Normal file
View File

@ -0,0 +1,9 @@
class Solution {
public:
int Fibonacci(int n) {
if (n == 0) return 0;
if (n == 1) return 1;
if (n == 2) return 1;
return Fibonacci(n - 1) + Fibonacci(n - 2);
}
};