Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int A[102][102],n,m,x,i,j,verificare=0;
- cin>>n;
- cin>>m;
- for(i=1;i<=n;i++)
- for(j=1;j<=m;j++)
- cin>>A[i][j];
- cin>>x;
- for(i=1;i<=n;i++)
- if((A[i][1]==x)||(A[i][m]==x))
- verificare=1;
- for(i=1;i<=m;i++)
- if((A[1][i]==x)||(A[n][i]==x))
- verificare=1;
- if(verificare!=0)
- cout<<"DA";
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement