object test03 { def main(args: Array[String]): Unit = { //to 每次迭代为1 val to1=1 to 10 print("to1"+to1) println() //to by 自定义迭代的大小 val to2=1 to 10 by 2 print("to2"+to2) println() //Range:until (包前不包后,每次迭代为1) val until1=1 until 10 print("until1"+until1) println() //Range:until by (自定义迭代) val until2=1 until 10 by 2 print("until2"+until2) } }