#include
using namespace std;
#include
int main()
{
int n, t, i, j;
int num;
int s;
cin >> n;
t = n;
num = 0, s = 0;
for (i = 2; i <= sqrt(n) + 1; i++)
if (n%i == 0)
{
t = n / i;
for (j = i + 1; j <= sqrt(n) + 1; j++)
if (t%j == 0) t = t / j;
else break;
if (j - i>num) num = j - i, s = i;
}
if (num == 0) { num = 1; s = n; }
cout << num << endl;
cout << s;
for (int i = s + 1; i <= s + num - 1; i++)
cout << "*" << i;
cout << endl;
return 0;
}
原文:http://www.cnblogs.com/code666/p/5844166.html