voidgetStart(int n, int m) { for (int i = 0; i <= n; i++) { if (map[i][0] == '.') { x = i, y = 0; return; } elseif (map[i][m] == '.') { x = i, y = m; return; } } for (int i = 1; i < m; i++) { if (map[0][i] == '.') { x = 0, y = i; return; } elseif (map[n][i] == '.') { x = n, y = i; return; } } }
intmain() { int n, m; while (scanf(" %d %d", &n, &m) == 2) { getchar(); for (int i = 0; i < n; i++) gets(map[i]); getStart(n - 1, m - 1); dfs(); printf("%d %d\n", x + 1, y + 1); } return0; }