add src-space c/cpp

This commit is contained in:
yenru0 committed 2025-05-08 03:25:39 +09:00
1 parent 07924bed36
commit 2886820691
5 files changed
+49 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#include <iostream>
int fib(int n) {
if (n == 0 || n == 1) {
return n;
}
return fib(n - 1) + fib(n - 2);
}
int main() {
int temp;
std::cin >> temp;
std::cout << fib(temp) << std::endl;
return 0;
}