Advertisement
treash

Untitled

Dec 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5. #include<iostream.h>
  6. #include<conio.h>
  7. //---------------------------------------------------------------------------
  8.  
  9. #pragma argsused
  10. int main(int argc, char* argv[])
  11. {
  12.     int n,m,p;
  13.     int a[100][100];
  14.     int b[10000];
  15.  
  16.  
  17.     cin>>n>>m;
  18.  
  19.     for (int i=1; i<=n; i++)
  20.         for (int j=1; j<=m; j++)
  21.             cin>>a[i][j];
  22.  
  23.     for (int i=1; i<=n; i++){
  24.         p=0;
  25.  
  26.         for (int j=1; j<m/2; j++)
  27.             if (a[i][j] != a[i][m-j+1]) p=1;
  28.  
  29.         if (p==1) b[i]=0;
  30.             else b[i]=1;
  31.  
  32.     }
  33.         cout<<endl;
  34.     for (int i=1; i<=n; i++)
  35.         cout<<b[i]<<" ";
  36.         getch();
  37.     return 0;
  38. }
  39. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement