//计算阶乘
double Factorial(int n)
{
if (n == 2)
{
return 2.0;
}
return n * Factorial(n - 1);
}
//计算常数e
double CalculateE(int n)
{
if (n == 2)
{
return 2.0 + 1.0 / Factorial(2);
}
return CalculateE(n - 1) + 1.0 / Factorial(n);
}
//计算阶乘
double Factorial(int n)
{
if (n == 2)
{
return 2.0;
}
return n * Factorial(n - 1);
}
//计算常数e
double CalculateE(int n)
{
if (n == 2)
{
return 2.0 + 1.0 / Factorial(2);
}
return CalculateE(n - 1) + 1.0 / Factorial(n);
}