Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int A[102][102],n,m,x,i,j,verificare=0;
  6. cin>>n;
  7. cin>>m;
  8. for(i=1;i<=n;i++)
  9. for(j=1;j<=m;j++)
  10. cin>>A[i][j];
  11. cin>>x;
  12. for(i=1;i<=n;i++)
  13. if((A[i][1]==x)||(A[i][m]==x))
  14. verificare=1;
  15. for(i=1;i<=m;i++)
  16. if((A[1][i]==x)||(A[n][i]==x))
  17. verificare=1;
  18. if(verificare!=0)
  19. cout<<"DA";
  20. else
  21. cout<<"NU";
  22. return 0;
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement