freddy2012 @ 2022-11-13 14:13:09
只通过了一二评测点
以下代码:
#include <bits/stdc++.h>
using namespace std;
long long f(int n)
{
if (n == 1) return 1;
return n * f(n - 1);
}
int main()
{
int n;
cin >> n;
long long temp = 0;
for (int i = 1; i <= n; i++)
{
temp += f(i);
}
cout << temp << endl;
return 0;
}
代码语言:C++14(GCC9)
by HUFT @ 2022-11-13 15:10:15
这道题是高精度