Advertisement
SergeyPGUTI

8.2.2(2)

Feb 18th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <string.h>
  4.  
  5.  
  6. using namespace std;
  7.  
  8.  
  9.  
  10. int main()
  11. {
  12.     int n;
  13.     cin>>n;
  14.     int ** p= new int*[n];
  15.  
  16.     for (int i=0;i<n;i++)
  17.     {
  18.         p[i]=new int[n];
  19.     }
  20.  
  21.     for(int i=0;i<n;i++)
  22.     {
  23.         for(int j=0;j<n;j++)
  24.             cin>>p[i][j];
  25.     }
  26.  
  27.     for (int i=0;i<n;i++)
  28.        for(int j=0;j<n;j++)
  29.             {
  30.                 if (p[i][j]!=p[j][i])
  31.                 {
  32.                 cout<<"no";
  33.                 return 0;
  34.                 }
  35.             }
  36.     cout<<"yes";
  37.  
  38.  
  39.     //вывод p
  40. //    for (int i=0;i<n;i++)
  41. //    {
  42. //
  43. //        for (int j=0;j<n;j++)
  44. //            {
  45. //                cout<<p[i][j]<<" ";
  46. //            }
  47. //            cout<<endl;
  48. //    }
  49.  
  50.  
  51.     return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement