说白了就是一个分解质因数
相比于自己之前写的,感觉这个清爽无比~
#include <iostream>
using namespace std;
int main()
{
int x,i;
while(cin >> x)
{
i = 2;
while(1)
{
if(i == x)
{
cout<<x<<endl;
break;
}
if(x % i == 0)
{
cout<<i<<"*";
x /= i;
}
else
++i;
}
}
}