voila le programme fonctionne
program carna107;
uses crt;
const dim=10;
var
mat1,mat2,mat3:array[0..dim,0..dim] of integer;
nl,nc,nc2,i,j,k:integer;
rep:char;
conf:char;
begin
repeat
clrscr;
writeln('Entrez le nombre de lignes de la matrice 1');
readln(nl);
writeln('Entrez le nombre de colonnes de la matrice 1');
readln(nc);
writeln('Entrez le nombre de colonnes de la matrice 2');
readln(nc2);
repeat
begin
writeln('Entree de la matrice 1');
writeln(' ');
for i:=1 to nl do
for j:=1 to nc do
begin
writeln('Entrez ligne ',i,' colonne ',j);
readln(mat1[i,j]);
end;
i:=0;
repeat
i:=i+1;
for j:=1 to nc do
write(mat1[i,j]:3);
writeln(' ');
until (i=nl);
writeln(' ');
writeln('Est ce la bonne matrice ? (O/N)');
readln(conf);
end;
until (conf='O') or (conf='o');
repeat
begin
writeln('Entree de la matrice 2');
writeln(' ');
for j:=1 to nc do
for k:=1 to nc2 do
begin
writeln('Entrez ligne ',j,' colonne',k);
readln(mat2[j,k]);
end;
j:=0;
repeat
j:=j+1;
for k:=1 to nc2 do
write(mat1[j,k]:3);
writeln(' ');
until (j=nc);
writeln(' ');
writeln('Est ce la bonne matrice ? (O/N)');
readln(conf);
end;
until (conf='O') or (conf='o');
begin
for i:=1 to nl do
for k:=1 to nc2 do
for j:=1 to nc do
mat3[i,k]:=mat3[i,k]+(mat1[i,j]*mat2[j,k]);
end;
writeln('Resultat');
for i:=1 to nl do
begin
for k:=1 to nc2 do
write(mat3[i,k]:3);
writeln(' ');
end;
writeln('Voulez vous recommencer ?(O/N)');
readln(rep);
until (rep='n') or (rep='N')
end.
mais je ne comprend pas pourquoi la méthode que j'utilise sur le poste au dessus fonctionne ici et pas dans celui d'avant et pourquoi il fonctionne pour les matrice 1 et 2 et pas pour la 3 contrairement a la méthode de guyver2 qui elle fonctionne pour la matrice 3