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