Files
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

23 lines
400 B
C++

#include <bits/stdc++.h>
using namespace std;
const int N = 110;
double a[N], c[N];
int main() {
a[1] = 2;
c[1] = 1;
a[2] = 3;
c[2] = 2;
double s = a[1] / c[1] + a[2] / c[2];
for (int i = 3; i <= 20; i++) {
a[i] = a[i - 1] + a[i - 2];
c[i] = c[i - 1] + c[i - 2];
s += a[i] / c[i];
}
cout << s << endl;
return 0;
}