基础题。
#include<iostream>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
int i;
for (i = 2; i <= n; i++)
{
if (n % i == 0)
{
n /= i;
if (n == 1)
cout << i << endl;
else
cout << i << "*";
i = 1;
}
}
}
return 0;
}
继续加油。