leetcode上能过,但是在这里就过不了,不知道为啥段错误:您的程序发生段错误,可能是数组越界,堆栈溢出(比如,递归调用层数太多)等情况引起 class Solution { public: vector<int> spiralOrder(vector<vector<int> > &matrix) { int direction[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; int x = 0, y = 0, m = matrix.size(), n = matrix[0].size(), index = ...