Share interests, spread happiness, increase knowledge, and leave a good stay!
Dear you, this is LearningYard.
Today, Xiaobian brings you "First Acquaintance with C++ (6) - Reaching the Peak", welcome to your visit.
Share interest, spread happiness, increase knowledge, and leave beautiful.
Dear, this is the LearingYard Academy!
Today, first introduction to C++ (VI) - The pinnacle,welcome to visit!
1. Cyclic nesting
1. Loop nesting
Loop nesting, that is, the loop contains another layer or multiple layers of loops, and multiple loops are implemented through two or more loop statements to solve the problem.
Loop nesting, that is, the loop contains another layer or multiple layers of loops, through two or more loop statements to achieve multiple loops, to solve the problem.
2. Cyclic nesting case - ninety-nine multiplication table
2. Circular nesting cases - 99 times table
Through two layers of cycles, the factors are multiplied in turn, and the ninety-nine multiplication table is output.
Through two layers of loops, multiplication of factors is realized in turn, and multiplication table 99 is output.
3. Jump statement (1) - break statement
3. Jump statement (1) -- break statement
The break statement is used to jump out of the loop or switch statement, and in the case of a multi-layer loop, only the loop of that layer can be jumped out, and the outer loop can continue to be executed.
The break statement is used to exit the loop or the switch statement. In a multi-layer loop, only the loop of this layer can be exited, and the outer loop continues to execute.
四、跳转语句(二)——continue语句
4. Jump statement (2) -- continue statement
The function of continue is to immediately execute the next cycle of the current layer loop, continue is the same as break, when there is a multi-layer loop, only the layer loop is used.
The function of continue is to execute the next loop of this layer immediately. continue, like break, applies only to the loop of this layer.
5. Jump statement (3) - goto statement
5. Jump statement (3) - goto statement
The goto statement is an unconditional and unlimited jump statement, which can jump out of multiple layers of loops, has no logic, and the code is poorly readable, so it is generally not used.
goto statement is an unconditional unlimited jump statement, can jump out of multi-layer loops, no logic, code readability is poor, so it is generally not used.
That's all for today's sharing,
If you have a unique idea for the article,
Feel free to leave us a message.
Let's meet tomorrow,
Have a great day!
That's all for today's sharing.
If you have a unique idea about the article,
please leave us a message,
and let us meet tomorrow.
I wish you a nice day!
Resources
Fundamentals of Python Programming
Translation: NetEase Youdao Translation
This article is organized and issued by LearningYard, if there is any infringement, please leave a message in the background to communicate.
文案|Dongyang
排版|Dongyang
Audit|hong
Learning Yard 新学苑