Home > Back-end >  Finish all the number between 2 ~ 1000, required output 5 in a row
Finish all the number between 2 ~ 1000, required output 5 in a row

Time:06-10

Want to ask the program which not

CodePudding user response:

It all true factor (i.e., in addition to its own approx) and (namely factor function), equals the itself,

You also do all its on judgment is equal to itself,

CodePudding user response:

reference 1st floor wowpH response:
it all true factor (i.e., in addition to its own approx) and (namely factor function), equals the itself,

You also do all its on judgment is equal to itself,
you didn't do all its in judging whether is equal to itself,

CodePudding user response:

reference wowpH reply: 3/f
Quote: refer to 1st floor wowpH response:

It all true factor (i.e., in addition to its own approx) and (namely factor function), equals the itself,

You also do all its on judgment is equal to itself,
you didn't do all its in judging whether is equal to itself,

The second for loop isn't it, is also a bracket

CodePudding user response:

CSDN BBS newbie guide


Copy and paste your code,

CodePudding user response:

Weixin_45812797
reference 4 floor response:
Quote: refer to the third floor wowpH response:
Quote: refer to 1st floor wowpH response:

It all true factor (i.e., in addition to its own approx) and (namely factor function), equals the itself,

You also do all its on judgment is equal to itself,
you didn't do all its in judging whether is equal to itself,

Is the second for loop, isn't it also add parentheses
inner loop misplaced the right parenthesis,

CodePudding user response:

refer to 6th floor wowpH response:
Quote: refer to 4th floor weixin_45812797 response:

Quote: refer to the third floor wowpH response:
Quote: refer to 1st floor wowpH response:

It all true factor (i.e., in addition to its own approx) and (namely factor function), equals the itself,

You also do all its on judgment is equal to itself,
you didn't do all its in judging whether is equal to itself,

Is the second for loop, isn't it also add parentheses
the inner loop of misplaced the right parenthesis,

Where to change one, or add a

CodePudding user response:

refer to 7th floor weixin_45812797 response:
Quote: refer to the sixth floor wowpH response:
Quote: refer to 4th floor weixin_45812797 response:

Quote: refer to the third floor wowpH response:
Quote: refer to 1st floor wowpH response:

It all true factor (i.e., in addition to its own approx) and (namely factor function), equals the itself,

You also do all its on judgment is equal to itself,
you didn't do all its in judging whether is equal to itself,

Is the second for loop, isn't it also add parentheses
the inner loop of misplaced the right parenthesis,

Where to change one, or add a
trouble don't ignore the 5 floor comments,

CodePudding user response:

reference 5 floor wowpH reply:
CSDN BBS newbie guide


Copy and paste your code,

Copy and paste the code
Then why

CodePudding user response:

When you ask this question, this post under a pile of calculating the number of blogs,

CodePudding user response:

Printf above the second right parenthesis will be moved to the cursor behind,

CodePudding user response:

Search for relevant procedure
The only thing

CodePudding user response:

references to the tenth floor wowpH response:
when you ask this question, this post under a pile of calculating the number of blogs,

Search for relevant procedure

CodePudding user response:

11 references wowpH response:
to printf above the cursor right parenthesis moved to behind, the second

Thank you thank you thank you thank you thank you (for at least ten words)

CodePudding user response:

Your s is not initialized to zero again.

CodePudding user response:

The
reference 15 floor confident boy reply:
your s not initialized to zero again.

B: yeah, isn't it at first, s=0

CodePudding user response:

According to the format posted your code,

CodePudding user response:

reference 16 floor weixin_45812797 response:
Quote: reference 15 floor confident boy reply:
your s not initialized to zero again.

B: yeah, isn't it at first, s=0

Only need to initialize it again? If so, is your s has been increased?

CodePudding user response:

I initialize, right

CodePudding user response:

Int main ()
{
int m=0;
For (int I=2; i <=1000; I++) {
Int s=0;
For (int t=1; T & lt; i; T++) {
If (I % t==0) {
S +=t;
}
}
If (s==I) {
M++;
Printf (" % d \ t ", I);
}
If (m % 5==0) {
printf("\n");
}
}

}


1, pay attention to your every time in the first cycle S want to assign a value of 0
2, judging whether the number of block if (s==n) in the second cycle, and within the first cycle,

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related