Home > Back-end >  For bosses to solve
For bosses to solve

Time:09-23

#include
#include

Int main ()
{
Int n, I, the sum=0;
For (n=2; N & lt;=1000; N++)
{
For (I=1; i {
If I (n %==0)
{
Sum=sum + I;

}
}
If (sum==n)
{
Printf (" % d its factors are ", sum);
For (I=1; i {
If I (n %==0)
{
Printf (" % d ", I);
}
}
printf("\n");
}
}
return 0;
The results is this how to return a responsibility??? O solve,,
}

CodePudding user response:

Every time need to assign the sum value of 0

CodePudding user response:

reference 1/f, the truth is right or wrong response:
every time need to assign the sum value of 0

Ok thank you, the run window not what the result is also changed

CodePudding user response:

No results showed that n==sum does not meet the conditions

CodePudding user response:

Because the sum as the cycle of overlay, can never equal the n
 for (n=2; N & lt;=1000; N++) 
{
sum=0;//add this
For (I=1; i {
If I (n %==0)
{
Sum=sum + I;

}
  • Related