Home > Back-end >  New guidance
New guidance

Time:10-06

Guide: while the usage, and need to pay attention to matters, I use the while always pay attention to the message

CodePudding user response:

Is really a novice, even ask questions all say not clear

CodePudding user response:

While is to establish a cycle, at the beginning of a cycle judgment conditions, if meet the execution of the loop body, does not meet the will exit the loop
Can also use the break statement inside the loop body jump out of the loop
While to notice first loop condition and the loop body matching, ensure that the number of actual execution cycle, and the expected
Also, pay attention to avoid infinite loop, in the loop body must be in the loop condition variables are modified, or have a break statement guarantee under certain conditions can exit the loop

CodePudding user response:

Textbooks again,

CodePudding user response:

While (write condition here) {loop body, specific do}, for example: while running (ten times) {run laps record}

CodePudding user response:

http://see.xidian.edu.cn/cpp/html/43.html
  • Related