Mottled @ 2024-02-07 20:35:24
#include <iostream>
using namespace std;
int main()
{
int n;
unsigned long long s = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
unsigned long long a = 1;
for (int j = 1; j <= i; j++)
{
a = a * j;
}
s += a;
}
cout << s;
return 0;
}
by littlesnake @ 2024-02-07 20:39:18
@Mottled 高精度。
by ny_jerry2 @ 2024-02-07 20:39:26
20!爆long long了
用高精度