From 352faa5ca0d65a5b534f650469b48fd19619bf20 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sat, 10 Oct 2020 18:17:00 +0800 Subject: [PATCH] =?UTF-8?q?21.=20=E6=96=90=E6=B3=A2=E9=82=A3=E5=A5=91?= =?UTF-8?q?=E6=95=B0=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/2610805/ --- AcWing/21/21.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 AcWing/21/21.cpp diff --git a/AcWing/21/21.cpp b/AcWing/21/21.cpp new file mode 100644 index 00000000..8f3b7b13 --- /dev/null +++ b/AcWing/21/21.cpp @@ -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); + } +};