提交时间:2025-10-18 18:11:19
运行 ID: 70596
#include<bits/stdc++.h> using namespace std; int main(){ int n; float s=0; cin>>n; for(int i=1;i<=n;i++){ s+=-1.0/i*pow(-1,i); } cout<<fixed<<setprecision(4)<<s; return 0; }