DS-Recursion

This commit is contained in:
e2hang
2025-07-17 15:30:55 +08:00
parent dd0d210e84
commit 2ed81d2e89
10 changed files with 56 additions and 0 deletions

15
Recursion/P28_20_Feb.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include <iostream>
using namespace std;
int feb(int n){
if(n > 1)
return feb(n - 1) + feb(n - 2);
return 1;
}
int main(){
for(int i = 1;i < 10; i++){
cout << feb(i) << endl;
}
return 0;
}