int m = GetData("M: ");
int n = GetData("N: ");
if (n < m)
throw new ArgumentOutOfRangeException();
Console.WriteLine("\nЧисло\t\t\tДелители");
for (int i = m; i <= n; i++)
{
int[] divisors = GetDivisors(i);
Console.WriteLine($"{i}\t\t\t{string.Join(" ", divisors)}");
}
int[] GetDivisors(int number)
{
int[] result = new int[0];
for (int i = 2; i < number; i++)
if (number % i == 0)
{
Array.Resize(ref result, result.Length + 1);
result[result.Length - 1] = i;
}
return result;
}
int GetData(string q)
{
Console.Write(q);
return Convert.ToInt32(Console.ReadLine());
}