50分,求助
查看原帖
50分,求助
1164330
JjHh楼主2024/5/22 21:56
#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
int n;
LL res;
int main() {
    cin >> n;
    LL f = 1;
    for (int i = 1; i <= n; i++) {
        f *= i;
        res += f;
    }
    cout << res ;
    return 0;
}
2024/5/22 21:56
加载中...