double FactorialSum(int m)
{
int fac=1,sum=0;
for(int n=1;n<=m;n++)
{
fac*=n;
sum+=fac;
}
return sum;
}
求1!+2!+3!+⋯+n!的值
最新推荐文章于 2024-08-28 09:23:53 发布
double FactorialSum(int m)
{
int fac=1,sum=0;
for(int n=1;n<=m;n++)
{
fac*=n;
sum+=fac;
}
return sum;
}