我想将setList设置为1到10,但是“ currentNumber”(列表的一项)不能转到Next !!
var numList = mutableSetOf(1)
for (currentNumber in numList) {
var temp = currentNumber
temp++
numList.add(temp)
if (currentNumber == 10)
break
}
println(" final List 0 to 10 $numList")
答案 0 :(得分:1)