Răspuns:
#include <iostream>
using namespace std;
int main()
{
int i,j,n,m,a[20][20],ok=1,k=0;
cout<<"Nr linii: ";
cin>>n;
cout<<endl;
cout<<"Nr coloane: ";
cin>>m;
cout<<endl;
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
cin>>a[i][j];
}
}
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
if(i!=j){
if(a[i][j]==a[j][i] && ok==1)
k++;
else
ok=0;
}
}
}
if(ok==1 && k>0)
cout<<"simetric";
else
cout<<"nu este simetric";
return 0;
}
Explicație: