Void main () {INT I, J, SUM; FOR (i = 1; i <= 1000; i ) {SUM = 0; for (j = 1; j <= I / 2; J ) IF (I% J == 0) SUM = J; if (SUM == i) {Printf ("% D ITS Factors Are", Sum); for (j = 1; j <= Sum / 2; J ) IF (SUM% J = = 0) Printf ("% d,", j); printf ("/ n");}} getch ();}
After finding the full definition, it is rewritten.
This time is finally correct.
This is an exercise problem in C language book.
I understand the full concept of the next thing, the factor is generally less than the number required to ask, and the number after the number is obtained, and there is no remainder, which is the number of all factors. .