Prime FactorDescription Give you a positive integer,please s
Prime Factor
Description
Give you a positive integer,please split it to some prime numbers,and you can got it through sample input and sample output.
Input
Input file contains multiple test case,each case consists of a positive integer n(1 < n < 65536),one per line.a negative terminates the input,and it should not to be processed.
Output
For each test case you should output its factor as sample output (prime factor must come forth ascending ),after each number you should output a space.There is a blank line between outputs.
Sample Input
60
12
-1
Sample Output
Case 1.
2 2 3 1 5 1
Case 2.
2 2 3 1
Hint
60=2^2*3^1*5^1
Source
hdu
这个hint 我有点看不懂 那16的话是写成 2 2 2 2 还是2 4
#include
#include
#include
int main()
{
int num;
int g=0;
while(scanf("%d",&num)!=EOF) //特别注意这行的写法
{
int i,j,k,flag,h,p,temp,m,num2;
g=g+1;
p=num;
if(num