Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int m,n,ok=1,k=0;
  8.     cin>>m;
  9.     cin>>n;
  10.     int a[m][n];
  11.     for(int i=0;i<m;i++)
  12.         {
  13.         for(int j=0;j<n;j++)
  14.             cin>>a[i][j];
  15.             cout<<endl;
  16.         }
  17.  
  18.     for(int i=0;i<m;i++)
  19.         {
  20.         for(int j=0;j<n;j++)
  21.     {
  22.         if(a[i][j]!=a[i][j+1])
  23.         ok=0;
  24.         else
  25.             ok=1;
  26.  
  27.     }
  28.         if(ok==0)
  29.             k++;
  30.         ok=1;
  31.         }
  32. cout<<k;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement