Advertisement
Guest User

symatric

a guest
Mar 10th, 2012
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.     int n;
  6.     cin>>n;
  7.     int arr[100][100];
  8.     int b[100];
  9.     int a[100];
  10.     for(int i=0;i<n;i++)
  11.     {
  12.     for(int j=0;j<n;j++)
  13.     {
  14.     cin>>arr[i][j];
  15.    
  16.     }
  17.     }
  18.     int h=0,k=0;
  19.     for(int i=0;i<n;i++)
  20.     {
  21.     for(int j=0;j<n;j++)
  22.     {
  23.              if(j>i)
  24.              {b[h]=arr[i][j];
  25.                  h++;
  26.                  
  27.              }
  28.              else if(j<i)
  29.              {
  30.              a[k]=arr[i][j];
  31.                 k++;
  32.              }
  33.     }
  34.    
  35.     }
  36.     int counter=0;
  37.     for(int i=0,j=h;i<h;j--,i++ )
  38.     {
  39.     if(a[j]==b[i])
  40.     {counter++;}
  41.     }
  42.     if(counter==(h))
  43.     {cout<<"symatric"<<endl;}
  44.         else
  45.          {cout<<"not symatric"<<endl; }
  46.  
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement