Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
5378 | 李成蹊 | 【基础题】求和(2) | C++ | Accepted | 0 MS | 240 KB | 188 | 2023-01-16 13:01:41 |
#include<bits/stdc++.h> #include<cstdio> using namespace std; int main() { float sum=0; for(int i=1;i<=100;i++){ sum+=(1*1.0/i); } cout<<fixed<<setprecision(3)<<sum; }