Run ID:114897

提交时间:2025-03-24 19:59:27

#include <stdio.h> int main() { int a,b,tmp; a=2;b=1; float s =a/(float)b; int n; scanf("%d",&n); for(int i=2;i<=n;i++) { tmp =a+b; b = a; a = tmp; s = s + a/(float)b; } printf("%.4f",s); return 0; }