注意边界,vector类型的vetctor时,即使塞入空的vector实例size()也不为零 #include <vector> class Solution { public: int step[4][2] = { 0, 1, 1, 0, 0, -1, -1, 0 }; vector<int> printMatrix(vector<vector<int> > matrix) { int n = matrix.size(); ...