At the end of the day, you can implement the exact same program using a while loop that you can using a for loop, it's just your code is going to look slightly different.
最终,你可以执行这个程序,再使用for循环的地方使用while循环,这只是使你的代码看起来稍微有点不同。
哈佛公开课 - 计算机科学课程节选
应用推荐
模块上移
模块下移
不移动