mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-19 20:55:57 +08:00
build
This commit is contained in:
@ -388,7 +388,7 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
在 `while` 循环中,由于初始化和更新条件变量的步骤是独立在循环结构之外的,**因此它比 `for` 循环的自由度更高**。
|
||||
**`while` 循环比 `for` 循环的自由度更高**。在 `while` 循环中,我们可以自由设计条件变量的初始化和更新步骤。
|
||||
|
||||
例如在以下代码中,条件变量 $i$ 每轮进行了两次更新,这种情况就不太方便用 `for` 循环实现。
|
||||
|
||||
|
Reference in New Issue
Block a user