object PrintMatrix_Scala {
def main(args: Array[String]): Unit = {
val matrix = Array(
Array( 1, 2, 3, 4),
Array( 5, 6, 7, 8),
Array( 9, 10, 11, 12),
Array(13, 14, 15, 16)
)
print(matrix.map(_.mkString(" ")).mkString("\n"))
}
}
/*
run:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
*/