题目描述:
Given a matrix A, return the transpose of A....The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column...1,4],[2,5],[3,6]]
Note:
1 <= A.length <= 1000
1 <= A[0].length <= 1000
要完成的函数:
vector> transpose...不过这里的二维vector不一定是方阵(也就是行数和列数不一定相等)。
比如[[1,2,3],[4,5,6]],转置之后结果是[[1,4],[2,5],[3,6]],其实也就是按列读取的结果。...代码如下:(附详解)
vector> transpose(vector>& A)
{
int hang=A.size()