Лабораторная работа № 0

Factorial Calculator

Арина Троян · Группа 1451

C# · Исходный код
using System;

class ABBA
{
static int Factorial(int n)
{
if (n == 1)
return 1;

return n * Factorial(n - 1);
}

static void Main()
{
Console.Write("Введите количество гласных: ");
int vowels = Convert.ToInt32(Console.ReadLine());

Console.Write("Введите количество согласных: ");
int consonants = Convert.ToInt32(Console.ReadLine());

int result = Factorial(vowels) * Factorial(consonants);

Console.WriteLine("Результат: " + result);
}
}
← Вернуться на главную