提交时间:2021-06-19 16:02:54
运行 ID: 20629
#include<bits/stdc++.h> using namespace std; int main(){ int n; int i; int sum = 0; float S = 0.0; cin>>n; for(i = 1;i<=n;i++){ sum += i; S += (float)1/sum; } cout<<sum; return 0; }