In the case of the first 50 primes in week five, continue jumps out of the question after the second cycle
This paragraph in the example:
========================================
Main_loop:
for (int x = 3; cnt<50; x + +)
{
for (int i=0; i<cnt; i++)
{
if (x%primes[i] = = 0)
{
Continue Main_loop;
}
}
}
===============================================
Why the "continue Main_loop" was executed; , "x + +" in for (int x = 3; cnt<50; x + +) also executes?
*************************************************
Re-review the knowledge of the For loop, organized the following ideas:
for (int i=0;i<cnt;i++)
As long as I<CNT is established
Continue running
Continue just jumped out of this i<cnt.
i++ continue to operate;
If you are using break, just jump out of the for loop for the for (int i=0;i<cnt;i++).
[JAVA] Onge teacher 0 basic Java language Fifth weeks continue puzzle in prime examples