continue跳过几层循环
时间: 2023-09-01 16:06:53 浏览: 216
continue语句可以跳过当前循环的剩余部分并开始执行下一次循环。在多重循环中,continue语句默认只会跳过当前循环。也就是说,它只会跳过最内层的循环。如果想要跳过外层循环,则可以使用带有标签的continue语句。通过在外层循环上方添加一个标签,在continue语句中指定该标签,就可以跳过多层循环。因此,continue语句可以跳过一层或者多层循环,具体取决于是否使用了标签。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [break和continue跳出多重循环](https://blog.csdn.net/weixin_39724194/article/details/105249384)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [continue / break 跳出指定层循环](https://blog.csdn.net/PorkCanteen/article/details/122327960)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文