Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
12221 | lulu | 【基础题】求和(2) | C++ | Accepted | 0 MS | 240 KB | 178 | 2023-03-19 22:25:24 |
#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; }