If a number is equal to the sum of all its factors (including 1 but not itself), it is called "Number of completion ". For example, if the factor of 6 is 1, 2, 3, and 1 + 2 + 3 = 6, 6 is a "complete number ".
Calculate and output the sum of all "completions" within 1000.
The specific requirements are as follows:
(1) All loops use the for loop.
(2) the output must have a text description, and each "Number" should be output at the same time ". The output format is
Complete number 1 + complete number 2 +... = Value
# Include <stdio. h>
# Include <conio. h>
# Include <math. h>
Void main ()
{
Int sum = 0, M, N, J, K;
Printf ("the sum of the over numbers that less than 1000 is: \ n ");
For (m = 2; m <= 1000; m ++)
{
K = m/2, n = 0;
For (j = 1; j <= K; j ++)
{
If (M % J = 0) n = N + J;
}
If (M = N)
{
Printf ("% d", m); printf ("+"); sum = sum + m;
}
}
Putchar ('\ B ');
Printf ("= % d", sum );
Getch ();
}