From 3a078b646fe47d5eaecd54e722bc93af68057007 Mon Sep 17 00:00:00 2001 From: test123 Date: Wed, 6 Nov 2024 06:57:27 +0000 Subject: [PATCH] Add fibo.cpp --- fibo.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fibo.cpp diff --git a/fibo.cpp b/fibo.cpp new file mode 100644 index 0000000..2a6598c --- /dev/null +++ b/fibo.cpp @@ -0,0 +1,10 @@ +#include + +int fibo(int n) { + if (n <= 1) return n; + return fibo(n - 1) + fibo(n - 2); +} + +int main() { + cout << fibo(5) << endl; +} \ No newline at end of file