矩阵转置
课程:golang · 编程练习
Go编程练习 - 矩阵转置
练习内容
package main\n\nimport "fmt"\n\nfunc transposeMatrix(matrix [][]int) [][]int {\n rows := len(matrix)\n cols := len(matrix[0])\n result := make([][]int, cols)\n\n for i := 0; i < cols; i++ {\n result[
课程:golang · 编程练习
Go编程练习 - 矩阵转置
package main\n\nimport "fmt"\n\nfunc transposeMatrix(matrix [][]int) [][]int {\n rows := len(matrix)\n cols := len(matrix[0])\n result := make([][]int, cols)\n\n for i := 0; i < cols; i++ {\n result[