Connect a nested loop to solve the problem of

Part brief question to ask is continue to affect the outer loop, rather than continue down the inner loop cycle.

In fact, that was stuck in the inside part, my mind is always thinking about how good use continue, but the solution is also very simple,

NA can continue, the role is nothing more than continue to meet the conditions of when to end the current cycle so that the code fails, continue to the next cycle,

When that condition is satisfied, doing nothing, would not skip with the same effect. So sometimes consider the issue from another direction, perhaps easier, here are

Code and run the results show, since there is no wrong to use to achieve the same effect is also possible.

 

 

Guess you like

Origin www.cnblogs.com/yp19970/p/12118288.html
Recommended