#include<stdio.h>
int main() {
double sum = 0;
double down = 1.0;
double up = 2.0;
sum += up / down;
int s;
for (int i = 1; i <20; i++) {
s = up + down;
down = up;
up = s;
sum += up / down;
}
printf("%lf", sum);
}
ps:开始结果算错是因为把分子分母类型定义成int了-_-||