vector<vector<int>> transpose(vector<vector<int>>& A) {    
    vector<vector<int>> V;
    int RowLen = A.size();
    int ColLen = A[0].size();
    for (int j = 0; j < ColLen; j++)
    {
        vector<int> v;
        for (int i = 0; i < RowLen; i++)
        {
            v.push_back(A[i][j]);
        }
        V.push_back(v);
    }
    
    return V;
}

 

posted on 2018-09-27 14:53  Sempron2800+  阅读(107)  评论(0编辑  收藏  举报