while continue break
时间: 2023-11-26 14:03:27 浏览: 88
在循环中,continue语句用于跳过当前迭代并进入下一次迭代,而break语句用于永久终止循环。 当在while循环中遇到continue语句时,它会跳过当前迭代并继续执行下一次迭代的循环体。而当遇到break语句时,会立即终止整个while循环,不再执行后续的迭代。综上所述,continue和break语句在while循环中的作用是控制循环的执行流程。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [while语句中的break和continue](https://blog.csdn.net/ACE_YOUNG/article/details/120072100)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [while、break、continue循环语句](https://blog.csdn.net/lyy962464/article/details/82390579)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [JavaScript break 和 continue 语句](https://download.csdn.net/download/weixin_38653687/13679698)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文