fork download
  1. #include<iostream>
  2. #include<math.h>
  3. #include<iomanip>
  4. #include <string>
  5. #include<algorithm>
  6.  
  7.  
  8. using namespace std;
  9.  
  10. void fast()
  11. {
  12. ios_base::sync_with_stdio(0);
  13. cin.tie(0);
  14. cout.tie(0);
  15. }
  16. int main()
  17. {
  18. fast();
  19.  
  20. int N, M;
  21. cin >> N >> M;
  22. char A[105][105];
  23.  
  24. for (int i = 0;i < N;i++) {
  25. for (int j = 0;j < M;j++) {
  26. cin >> A[i][j];
  27. }
  28. }
  29.  
  30. int x, y;
  31. cin >> x >> y;
  32.  
  33. char B[105];
  34.  
  35. B[0] = A[x - 1][y - 1];
  36. B[1] = A[x][y - 1];
  37. B[2] = A[x + 1][y - 1];
  38. B[3] = A[x + 1][y];
  39. B[4] = A[x - 1][y];
  40. B[5] = A[x - 1][y + 1];
  41. B[6] = A[x][y + 1];
  42. B[7] = A[x + 1][y + 1];
  43.  
  44. for (int i = 0;i <= 7;i++) {
  45. if (B[i] != '.') {
  46.  
  47. }
  48. else {
  49. cout << "no";
  50. return 0;
  51. }
  52.  
  53. }
  54. cout << "yes";
  55.  
  56. return 0;
  57. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
yes