chengxin1342 @ 2024-09-05 13:09:23
#include<iostream>
#include<vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> a(N + 1);
int tmp=0;
if (N <= 1) {
return 1;
}
else {
a[0] = 1;
a[1] = 2;
for (int i = 2; i <N; i++) {
a[i] = a[i - 1] + a[i - 2];
}
}
for (int i = 0; i < N; i++) {
tmp += a[i];
}
cout << a[N-1];
return 0;
}
by dongzirui0817 @ 2024-09-05 13:12:40
@chengxin1342 请用高精度
by zjh4188 @ 2024-09-05 13:18:12
菜就多练
by EBIMAYO @ 2024-09-05 13:20:09
@zjh4188 这道题目要高精度啊,整形会炸吧。