You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
305 B

#include <bits/stdc++.h>
using namespace std;
const int N = 210;
long long a[N];
long long fib(int n) {
if (n == 1) return 1;
if (n == 2) return 1;
if (a[n]) return a[n];
return a[n] = fib(n - 1) + fib(n - 2);
}
int main() {
printf("%lld", fib(100));
return 0;
}