#include<bits/stdc++.h>
using namespace std;
#define L long long int
int main()
{
L i, j, k, n, m, f, d, c;
char ch, an;
while(cin >> m)
{
for(k=1;k<=m;k++)
{
cin >> ch >> an >> n;
f = c = 0;
L a[n][n], b[n][n];
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
cin >> d;
if(d<0)
{
f = 1;
}
a[i][j] = b[n-1-i][n-1-j] = d;
}
}
if(f == 1)
{
cout << "Test #" << k << ": " << "Non-symmetric." << endl;
continue;
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i][j] != b[i][j])
{
c = 1;
break;
}
}
}
if(c == 1)
{
cout << "Test #" << k << ": " << "Non-symmetric." << endl;
}
else
{
cout << "Test #" << k << ": " << "Symmetric." << endl;
}
}
}
return 0;
}
using namespace std;
#define L long long int
int main()
{
L i, j, k, n, m, f, d, c;
char ch, an;
while(cin >> m)
{
for(k=1;k<=m;k++)
{
cin >> ch >> an >> n;
f = c = 0;
L a[n][n], b[n][n];
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
cin >> d;
if(d<0)
{
f = 1;
}
a[i][j] = b[n-1-i][n-1-j] = d;
}
}
if(f == 1)
{
cout << "Test #" << k << ": " << "Non-symmetric." << endl;
continue;
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i][j] != b[i][j])
{
c = 1;
break;
}
}
}
if(c == 1)
{
cout << "Test #" << k << ": " << "Non-symmetric." << endl;
}
else
{
cout << "Test #" << k << ": " << "Symmetric." << endl;
}
}
}
return 0;
}
Comments
Post a Comment