Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这些循环用于向后迭代二维数组,但我在 Python 中太绿了,所以有人可以帮忙吗?这就是我用 Java 编写它们的方式:
for (int i = rows - 1; i >= 0; i--) { for (int j = cols - 1; j >= 0; j--) { int target = A[i][j]; } }
这就是代码在 python 中的样子:
for i in range(rows-1,-1,-1): for j in range(cols-1,-1,-1): target = A[i][j]