救命//1213求sn的和(那错了)

Kinghero King of the summit 2022-07-08 10:37:41 0
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
    double n, m;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        m += 1.0 / i;
        }
    printf("%.2lf", m);
    return 0;
}
{{ vote && vote.total.up }}

共 2 条回复

Kinghero King of the summit

CPP 刷题王

m没赋值0