
romain60112
|
Bonsoir,
Je rencontre un soucis, je n'arrive pas a comparer deux matrices.
J'ai écrit un petit bout de code qui ne fonctionne pas le voici :
int Mat1[10][10] = {
0,1,1,1,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0,1,
0,0,0,0,0,1,0,0,0,1,
0,0,1,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,
};
int Mat2[10][10] = {
0,1,1,1,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0,1,
0,0,0,0,0,1,0,0,0,1,
0,0,1,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,
};
for(int i=0; i<10; i++)
{
for(int j=0; j<10; j++)
{
if(Mat1[j][i] == Mat2[j][i])
{ cout<<"Matrice Egale"<<endl;
}
else
{cout<<"Matrice pas Egale"<<endl;
}
}
}
Quel est mon erreur ?
Merci
Romain
|