暴力破解法简单粗暴
# include <iostream>
# include <algorithm>
# include <set>
# include <vector>
# include <cmath>
# include <cstdio>
using namespace std;
int main(int argc, char *argv[])
{
int n;
while(cin >> n)
{
int k = sqrt(double(n));
int flag = 0;
int maxx = 0;
int f = n;
int s = 0;
for(int i = 2; i <= k; i++)
{
if(f % i == 0)
{
flag = 1;
int countt = 0;
for(int j = i; f % j == 0; j++)
{
countt++;
f /= j;
}
if(maxx < countt)
{
maxx = countt;
s = i;
}
f = n;
}
}
if(flag == 0)
{
cout << "1" << '\n' << n << endl;
continue;
}
cout << maxx << endl;
int p = 0;
for(int i = s; i < s + maxx; i++)
{
if(p)
{
cout << "*";
}
p = 1;
cout << i;
}
cout << endl;
}
return 0;
}