fun main() {
val numbers1 = listOf<Int>(213, 4, 534, 646, 757, 8, 97, 9);
val numbers2 = listOf<Int>(214, 5, 535, 647, 758, 9, 98, 10);
val res=numbers1.zip(numbers2)
println(res)
}
注意 返回类型是这个
public infix fun <T, R> Iterable<T>.zip(other: Iterable<R>): List<Pair<T, R>> { return zip(other) { t1, t2 -> t1 to t2 } }
List<Pair<T, R>>