当前位置:网站首页>Continue and break jump out of multiple loops

Continue and break jump out of multiple loops

2022-07-06 16:44:00 HBUcs2020

When does it end

Double inner circle continue It will also be after meeting the conditions for ending the cycle , The subsequent circulation body is still unaffected

continue The function of the statement is to skip the remaining unexecuted statements in the body of this loop , Immediately carry out the next cycle condition determination , It can be understood as only ending this cycle .

Be careful :continue Statement does not terminate the entire loop .

break: This statement causes the program to terminate the loop that contains it , And proceed to the next stage of the process ( The statement after the whole loop ), namely , Instead of jumping to the next cycle, exit the cycle . If break sentence Contained in nested loops , It just jumps out of the innermost loop .

原网站

版权声明
本文为[HBUcs2020]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131314583885.html