这么写过了?!
for (int j = i + 1; j <= n; j++) { if (fabs(mat[i][j]) > fabs(mat[i][mx])) { mx = j; } }
这份代码找的是行内max啊