fun main(args: Array<String>) {
var a=0
while (a<=100){
println(a)
a++
}
a=0
println("\n\n")
do {
println(a)
a++
}while (a<=100)
}
简单的语法和java一样,do-while会先走循环体
fun main(args: Array<String>) {
var a=0
while (a<=100){
println(a)
a++
}
a=0
println("\n\n")
do {
println(a)
a++
}while (a<=100)
}
简单的语法和java一样,do-while会先走循环体
本文标题:16.while和do-while
本文链接:https://www.haomeiwen.com/subject/ddhiuctx.html
网友评论