3.
#include
#include
IntIsPrime (intn);
VoidFactorizePrime (intn);
Intmain ()
{
Intn;
The scanf (" % d ", & amp; n);
If (IsPrime (n)==0)
{
Printf (" % d can be decomposed into: ", n);
FactorizePrime (n);
}
The else
Printf (" % d is a prime number, does not decompose \ n ", n);
return0;
}
IntIsPrime (intn)
{
Inti;
For (I=2; i<=(int) SQRT (n); I++)
If I (n %==0)
return0;
Return1;
}
VoidFactorizePrime (intn)
{
Inti;
While (1)
{the for (I=2; i<=n; I++)
If I (n %==0)
{
printf("%d",i);
N=n/I;
break;
}
If (n==1)
break;
}
}
CodePudding user response:
How do you understand look not to understand this programCodePudding user response:
A function is a function, such as the following function is the judgment of prime Numbers,IntIsPrime (intn)
This is the judgment factor
VoidFactorizePrime (intn)
CodePudding user response:
If the two break is not in the same layer in the loop?CodePudding user response: