Код: Выделить всё
e = 1 + (1 / 1!) + (1 / 2!) + (1 / 3!) + ...Код: Выделить всё
//n! = n * (n - 1)*(n - 2)*...* 1
//5! = 5 * (5 - 1)*(5 - 2)*(5 - 3)*(5 - 4)*(5 - 5)
//5! = 5 * 4 * 3 * 2 * 1 * 0
//5! = 120
int num = A;
while (num > 0)
{
A = num;
for (int i = A - 1; i > 0; i--)
{
A *= i;
}
Console.WriteLine($"Fractorial of {A}! = {num}\n");
num--;
}
Этот ответ не использует функция System.Math.E.
Подробнее здесь: https://stackoverflow.com/questions/790 ... constant-e
Мобильная версия