题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
#include<stdio.h>
#include<math.h>
int main()
{
int input=0;
int sqrtinput=0;
int test=2;
scanf("%d",&input);
int temp=input;
while(1)
{
sqrtinput=sqrt(temp);
if(test>sqrtinput)
{
printf("%d ",temp);
break;
}
else if(temp%test==0)
{
printf("%d ",test);
temp/=test;
}
else
{
test++;
}
}
}
