using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace ConsoleApp6
{
internal class Program
{
static void Main(string[] args)
{
int N = int.Parse(Console.ReadLine());
int start = 0;
int max = 0;
for(int i = 2; i < N; i++)
{
int result = 1;
int count = 0;
for (int j = i; N % (result * j) == 0; j++)
{
count++;
result *= j;
}
if (count > max)
{
start = i;
max = count;
}
}
if (max == 0)
{
Console.WriteLine(1);
Console.WriteLine(N);
}
else
{
Console.WriteLine(max);
int i = start;
for (; i < start + max - 1; i++)
{
Console.Write(i + "*");
}
Console.WriteLine(i);
}
}
}
}
pintia连续因子
最新推荐文章于 2024-09-15 19:46:31 发布