def dfs(i,j): ''' 该函数作用为输出从坐标为i,j的点走到终点的路径 ''' #dx,dy用于控制探索方向,依次为下,上,左,右 dx = [0,0,-1,1] dy = [-1,1,0,0] if i == m-1 and j == n-1: for pos in route: print('('+str(pos[0])+','+str(pos[1])+')') return for k in range(4):#对上下左右四个方向便利 ...