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.