0
已采纳
前面定义(n,i=2),输入n
while(n%i==0)
{
cout<<i;
n/=i;
if(n!=1)
{
cout<<" ";
}
}i++;
然后输出i-1即可,因为i=2
0
for (int i=2; i<=(int)(sqrt(n)); i++)
{
if (n%i==0)
{
cout<<i<<" "<<n/i<<" "<<n/i<<endl;
}
}
0
0
0
0