To represent a maze, we set the following array mg in which each element represents a block. 0 indicates the block is a path, and 1 indicates the block is a wall. int mg[M+1][N+1]={ /*M=10,N=10*/{1,1,1,1,1,1,1,1,1,1}, {1,0,0,1,0,0,0,1,0,1},{1,0,0,1,0,0,0,1,0,1}, {1,0,0,0,0,1,1,0,0,1}, {1,0,1,1,1,0,0,0,0,1}, {1,0,0,0,1,0,0,0,0,1}, {1,0,1,0,0,0,1,0,0,1}, ...