Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
20771 | LeoWang | 【基础题】求和(2) | C++ | Accepted | 0 MS | 248 KB | 178 | 2023-06-20 08:16:31 |
#include<bits/stdc++.h> using namespace std; int main() { float sum=0; for(int i=1;i<=100;i++){ sum+=(float)1/i; } cout<<fixed<<setprecision(3)<<sum; return 0; }