我也是, 第二题 func main() { var n, m, k int var s string fmt.Scanf("%d %d %d", &n,&m,&k) fmt.Scanf("%s", &s) data := make([][]int, n) for i,_ := range data { data[i] = make([]int, m) } data[0][0] = 1 count := 1 tempi := 0 tempj := 0 for i:=0; i<k; i++ { fmt.Println(tempi, tempj, data[tempi][tempj], s[i], count) if count == m*n { fmt.Println("Yes") fmt.Println(i) return } if s[i] == 'W&(30501)#39; { if tempi > 0 { tempi-- if data[tempi][tempj] == 0 { data[tempi][tempj] = 1 count++ } } } else if s[i] == 'D&#39; { if tempj < m-1 { tempj++ if data[tempi][tempj] == 0 { data[tempi][tempj] = 1 count++ } } } else if s[i] == 'S&(30503)#39; { if tempi < n-1 { tempi++ if data[tempi][tempj] == 0 { data[tempi][tempj] = 1 count++ } } } else { if tempj > 0 { tempj-- if data[tempi][tempj] == 0 { data[tempi][tempj] = 1 count++ } } } }