add test4 file

This commit is contained in:
2025-04-08 17:24:19 +08:00
parent c5207d28d8
commit 6bc0727b8b

14
others/test4.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5+7;
int dp[N];
signed main(){
dp[1] = dp[2] = 1;
int n; cin >> n;
for(int i = 3; i <= n; i++){
dp[i] = dp[i-1] + dp[i-2];
}
cout << dp[n] << endl;
return 0;
}