Print? # Include <stdio. h>
Int main ()
{
Int I;
Int j = 0;
Int begin_num;
Int num;
Int mark;
Int count [100];
Int collect [100] = {0 };
Printf ("please enter a number :");
Scanf ("% d", & num );
Begin_num = num; // use begin_num to keep num. The following Operation changes the value of num.
For (I = 1; 2 * I-1 <num; I ++) // use an odd number, an even number is omitted
{
Mark = 2 * I-1; // odd
If (mark = 1) // increase by 2 because 2 is an even number of prime numbers.
{
Mark = 2;
}
If (num % mark = 0)
{
Count [j] = mark; // records the number of times a mark is divided.
While (num % mark = 0)
{
Num = num/mark;
Collect [j] ++; // records the number of times a mark is divided.
}
J ++;
}
}
For (I = 0; I <j; I ++)
{
If (I = 0) // limit printing once
{
Printf ("% d =", begin_num );
}
Printf ("% d (% d)", count [I], collect [I]);
If (I = J-1) // last line feed
{
Printf ("\ n ");
}
}
}
# Include <stdio. h>
Int main ()
{
Int I;
Int j = 0;
Int begin_num;
Int num;
Int mark;
Int count [100];
Int collect [100] = {0 };
Printf ("please enter a number :");
Scanf ("% d", & num );
Begin_num = num; // use begin_num to keep num. The following Operation changes the value of num.
For (I = 1; 2 * I-1 <num; I ++) // use an odd number, an even number is omitted
{
Mark = 2 * I-1; // odd
If (mark = 1) // increase by 2 because 2 is an even number of prime numbers.
{
Mark = 2;
}
If (num % mark = 0)
{
Count [j] = mark; // records the number of times a mark is divided.
While (num % mark = 0)
{
Num = num/mark;
Collect [j] ++; // records the number of times a mark is divided.
}
J ++;
}
}
For (I = 0; I <j; I ++)
{
If (I = 0) // limit printing once
{
Printf ("% d =", begin_num );
}
Printf ("% d (% d)", count [I], collect [I]);
If (I = J-1) // last line feed
{
Printf ("\ n ");
}
}
}