标签:
#include <iostream>
using namespace std;
#include <cmath>
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