5.2.1.4 引入变量
package com.atguigu.day02
import scala.util.control.Breaks
object ForDemo6 {
def main(args: Array[String]): Unit = {
for (i <- 1 to 10; j = 20; k = 30) {
println(i + " " + j + " " + k)
}
// 等价于
for (i <- 1 to 10; j = 20; k = 30) {
println(i + " " + j + " " + k)
}
}
}