当前位置:网站首页>10 - process control - while loop statement
10 - process control - while loop statement
2022-04-22 05:58:00 【ʕ·͡ˑ· ཻ ʔ**ʕ·͡ˑ· ཻ ʔ】
Catalog
3、 ... and 、while Loop examples
6、 ... and 、while And break Combined with examples
One 、 The role of circulation
-
Give Way Specified code Repeated execution .
Two 、while sentence
-
Application scenarios :while The most common application scenario for loops is , Let the specified code , According to the specified number of times , repeat .
-
while sentence Basic grammar
3、 ... and 、while Loop examples
-
Print 100 This time I was wrong
-
Calculation 0~100 The sum of all the numbers
Four 、 Dead cycle
-
Definition : Since the cycle conditions are always met , The program will continue to run , A cycle that does not stop .
-
Be careful : Under certain scenario requirements , When the program needs to be executed repeatedly , It can be set as an endless loop ? What scene ?
5、 ... and 、break keyword
-
Definition : When a condition is met , Exit the current loop statement :
-
Be careful :break Is a keyword used exclusively in circular statements .
6、 ... and 、while And break Combined with examples
-
All together 5 An apple , Finish the first one , Eat the second one …
-
If you eat in the process , The third one is full , You don't need to eat the second one 4 First and fifth Apple , That is, the action of eating apples stops .
版权声明
本文为[ʕ·͡ˑ· ཻ ʔ**ʕ·͡ˑ· ཻ ʔ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220538317017.html
边栏推荐
- Convolutional neural network
- B/S架构
- LeetCode 514. The road of freedom -- dynamic programming
- 棋盘覆盖问题(分治)
- 本地搭建服务器后的访问问题
- 蓝桥杯31天冲刺 Day17
- Converts a nonnegative decimal integer n to a binary
- Langue C - 100 questions classiques
- LeetCode 99. Restore binary search tree -- medium order traversal + sorting
- 蓝桥杯31天冲刺 Day4
猜你喜欢

redis:redis-cli不是内部或外部命令

Golang calculates the number of days rounded to time

PyQT5总结

苹果 CMS 搭建视频网站,定时采集视频

LeetCode 2044. Count the number of subsets that can get the maximum value by bit -- depth traversal

09 - 流程控制 - 判断语句

conda命令

苹果cms设置本地播放器 ckplayer(版本:ckplayerx)

Basic knowledge of software testing

Cytoscape安装教程
随机推荐
Apple CMS custom docking WeChat official account
PyQT5总结
Miniconda source swap (add image)
LeetCode 2049. Count the number of nodes with the highest score -- traversal of the tree
Converts a nonnegative decimal integer n to a binary
LeetCode 2055. Plates between candles -- prefix and + interval mark
非负的十进制整数N转换为一个二进制
0/1背包问题(动态规划+动规优化)
最大连续子序列和(枚举+分治+在线处理)
ubuntu20.0.4下在终端安装数据库
redis定时写入,直播流视频拉取
Digital DP (template)
Blue Bridge Cup 31 day sprint Day3
Alist easy to use guide
Blue Bridge Cup 31 day sprint Day17
链表的逆序输出 C语言三行代码 递归栈
蓝桥杯31天冲刺 Day5
判断链表是否有环(集合&快慢指针)
Redis: redis cli is not an internal or external command
Judge whether the linked list has a ring (Set & speed pointer)