• Source
    1. #include<bits/stdc++.h>
    2. using namespace std;
    3. long long mat[105][105];
    4. int main()
    5. {
    6. long long test,n,i,j,k,l,counter,counter1,x,tag;
    7. string ch,ch1;
    8. scanf("%lld",&test);
    9. for(x=1;x<=test;x++)
    10. {
    11.  
    12. cin>>ch>>ch1>>n;
    13.  
    14. tag=0;
    15.  
    16. for(i=0;i<n;i++)
    17. {
    18. for(j=0;j<n;j++)
    19. {
    20. scanf("%lld",&mat[i][j]);
    21. if(mat[i][j]<0)
    22. {
    23. tag=1;
    24. }
    25. }
    26. }
    27.  
    28. if(tag==1)
    29. {
    30. printf("Test #%lld: Non-symmetric.\n",x);
    31. continue;
    32. }
    33. counter=0;
    34. counter1=0;
    35.  
    36. for(i=0;i<n;i++)
    37. {
    38. for(j=0;j<n;j++)
    39. {
    40. if(mat[i][j]!=mat[n-i-1][n-j-1])
    41. {
    42. tag=1;
    43. }
    44. }
    45. }
    46. if(tag==0)
    47. {
    48. printf("Test #%lld: Symmetric.\n",x);
    49. }
    50. else
    51. {
    52. printf("Test #%lld: Non-symmetric.\n",x);
    53. }
    54. }
    55. return 0;
    56. }
    57.