double cycle

Double loop
1. Double loop
① One loop body contains another complete loop body structure
(the outer loop variable changes once, and the inner loop variable changes once)

2. Double loop printing graphics
* number of lines controlled by outer loop
* number of columns controlled by inner loop
① Find the number of rows, determine the number of outer loops
② Find the number of columns, determine the number of inner loops
③ Find the relationship, determine each row Number of outputs
④Find the output content and determine the output information

3. The keywords break and continue in the double loop
①continue skips the current loop and enters the next loop of this round (go to the next round of this loop)
②break jumps out of the inner loop and executes the outer loop statement (jumps out of this loop )

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325224452&siteId=291194637