标签: swift
有没有办法以一行代码或更短的形式制作这些循环?
var matrix : [[Int]] = [ [0,1,2,9], [3,4,5,2], [1,3,1,5] ] for i in rowIndexes { for c in 0..<nCol { matrix[i][c] = 0 } } output : [[Int]] = [ [0,0,0,0], [3,4,5,2], [1,3,1,5] ]