提交时间:2026-05-07 16:40:52

运行 ID: 439405

#include<bits/stdc++.h> using namespace std; int main(){ double s=0; int n,i=1; cin>>n; while(i<=n){ s=s+1.0/i; i++; } cout<<fixed<<setprecision(3)<<s; return 0; }