提交时间:2024-08-22 14:02:22
运行 ID: 291774
#include<bits/stdc++.h> using namespace std; int main() { double s; int n; cin>>n; for(int i=1;i<=n;i++){ s+=1/i; } cout<<fixed<<setprecision(3)<<s; return 0; }