企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
do-while 循环由 do 关键字开始,后跟循环体表达式。其后跟while 关键字,然后是一个 开口的圆括号 (,再跟条件表达式和一个闭口的圆括号 ) : > A do-while loop starts with the do keyword followed by the loop body expression. After that follows the while keyword, an opening parenthesis (, the condition expression and a closing parenthesis ): ~~~ do expression while(condition); ~~~ 条件表达式必须为Bool类型。 > The condition expression has to be of type Bool. 如语法所暗示的,循环体表达式至少会执行一次,这和 while循环(第5.14节)不同。 > As the syntax suggests, the loop body expression is always evaluated at least once, unlike while (5.14) loops.