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