repeat.while循环类似于while循环,不同之处在于保证至少执行一次repeat.while循环。
SWIFT 4中repeat.while循环语法为-
repeat { statement(s); } while( condition );
var index=10 repeat { print( "Value of index is\(index)") index=index + 1 } while index < 20
执行上述代码时,将生成以下结果-
Value of index is 10 Value of index is 11 Value of index is 12 Value of index is 13 Value of index is 14 Value of index is 15 Value of index is 16 Value of index is 17 Value of index is 18 Value of index is 19
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
Spring Boot与Kubernetes云原生微服务实践 -〔杨波〕
Spring Cloud 微服务项目实战 -〔姚秋辰(姚半仙)〕