aishiteru_mitsu_ha @ 2024-03-07 17:51:33
#include<iostream>
using namespace std;
long long lt(long long n) {
if (n == 1 || n == 0) {
return 1;
}
return lt(n - 1) + lt(n - 2);
}
int main() {
long long a;
cin >> a;
cout << lt(a);
return 0;
}
by __Rickysun__ @ 2024-03-07 18:03:35
@not_much 这题是斐波那契数列,得用
by xk2013 @ 2024-03-07 18:08:09
@not_much 用递推啊 awa
by xk2013 @ 2024-03-07 18:18:08
@Rickysun unsigned __int128
行不?
by yuhaiyue @ 2024-03-23 11:23:21
用递推