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