#include <iostream>
using namespace std;
int main(void)
{
long long num;
cin >> num;
for (int i = 2; i * i <= num; i++)
{
while (num % i == 0)//如果能整除i,一直整除下去,把i这个因子全部找出来
{
num /= i;
cout << i << " ";
}
}
if (num > 1)//对于本身就是质数的num,输出即可
{
cout << num << " ";
}
return 0;
}
刷题06:HJ6
猜你喜欢
转载自blog.csdn.net/qq_27538633/article/details/115403241
今日推荐
周排行