提交时间:2021-06-19 21:11:43

运行 ID: 20739

#include<stdio.h> int main(){ int n; int i; int sum = 0; float S = 0.0; scanf("%d",&n); for(i = 1;i<=n;i++){ sum += i; S += (float)1/sum; } printf("%f\n",sum); return 0; }