break 和continue 区别和用法

1、break 再循环中的作用是 跳出一个循环或者结束一个循环
image
输出
image

2、continue立即结束本次循环,继续执行下一次循环
image
输入出
image

posted @ 2022-02-26 21:59  岁末年初  阅读(322)  评论(0)    收藏  举报