fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, m; cin >> n >> m;
  7. char arr[101][101] = {'x'};
  8. for (int i = 1; i <=100; i++) {
  9. for (int j = 1; j <= 100; j++)arr[i][j] = 'x';
  10. }
  11. for (int i = 1; i <= n; i++)for (int j = 1; j <= m; j++)cin >> arr[i][j];
  12. int x, y;cin >> x >> y;
  13. cout << (arr[x][y - 1] == 'x' && arr[x][y + 1] == 'x' && arr[x - 1][y - 1] == 'x' && arr[x - 1][y + 1] == 'x' && arr[x - 1][y] == 'x' && arr[x + 1][y - 1] == 'x' && arr[x+1][y + 1] == 'x' && arr[x + 1][y]? "yes":"no");
  14. }
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
no