Exercices sur les matrices
Résolu/Fermé
geronimo_2007
Med - 24 mai 2010 à 15:52
- Messages postés
- 4
- Date d'inscription
- samedi 3 mars 2007
- Statut
- Membre
- Dernière intervention
- 6 mars 2007
Med - 24 mai 2010 à 15:52
A voir également:
- Algorithme matrice exercice corrigé
- Algorithme matrice exercice corrigé pdf - Meilleures réponses
- Exercice corrigé algorithme matrice pdf - Meilleures réponses
- Algorithme matrice exercice corrigé pdf ✓ - Forum - Programmation
- Algorithme 3ème exercices corrigés ✓ - Forum - Programmation
- Algorithme suite exercice corrigé ✓ - Forum - Programmation
- Algorithme boucle pour exercice corrigé ✓ - Forum - Algorithmes / Méthodes
- Exercice algorithme triangle pascal corrigé pdf ✓ - Forum - Pascal
14 réponses
google tu connais?
tape exercies sur les matrices avec solution en pascal et tu verras...
voici un exemple :
program produit_mat(input,output);
var m1,m2,m3:array[1..10,1..10]of real;
l,m,n,jl,jm,jn:integer;
begin
writeln('nb lignes 1ère matrice ?');
readln(m);
writeln('nb colonnes 1è matrice ?');
readln(l);
writeln('nb colonnes 2è matrice ?');
readln(n);
(* entrée de m1 *)
writeln('première matrice');
for jm:=1 to m do for jl:=1 to l do
begin
writeln('lig',jm,', col',jl,'?');
readln(m1[jm,jl])
end;
(* entrée de m2 *)
writeln('2ième matrice');
for jl:=1 to l do for jn:=1 to n do
begin
writeln('lig',jl,', col',jn,'?');
readln(m2[jl,jn])
end;
(* calcul du produit *)
for jm:=1 to m do for jn:=1 to n do
begin {calcul composante m,n de m2}
m3[jm,jn]:=0;
for jl:=1 to l do m3[jm,jn]:=
m3[jm,jn]+(m1[jm,jl]*m2[jl,jn]);
end;
(* affichage du résultat *)
writeln('résultat');
for jm:=1 to m do for jn:=1 to n do
writeln('m[',jm,',',jn,']=',
m3[jm,jn])
end.
@I'm the god father@
tape exercies sur les matrices avec solution en pascal et tu verras...
voici un exemple :
program produit_mat(input,output);
var m1,m2,m3:array[1..10,1..10]of real;
l,m,n,jl,jm,jn:integer;
begin
writeln('nb lignes 1ère matrice ?');
readln(m);
writeln('nb colonnes 1è matrice ?');
readln(l);
writeln('nb colonnes 2è matrice ?');
readln(n);
(* entrée de m1 *)
writeln('première matrice');
for jm:=1 to m do for jl:=1 to l do
begin
writeln('lig',jm,', col',jl,'?');
readln(m1[jm,jl])
end;
(* entrée de m2 *)
writeln('2ième matrice');
for jl:=1 to l do for jn:=1 to n do
begin
writeln('lig',jl,', col',jn,'?');
readln(m2[jl,jn])
end;
(* calcul du produit *)
for jm:=1 to m do for jn:=1 to n do
begin {calcul composante m,n de m2}
m3[jm,jn]:=0;
for jl:=1 to l do m3[jm,jn]:=
m3[jm,jn]+(m1[jm,jl]*m2[jl,jn]);
end;
(* affichage du résultat *)
writeln('résultat');
for jm:=1 to m do for jn:=1 to n do
writeln('m[',jm,',',jn,']=',
m3[jm,jn])
end.
@I'm the god father@
5 mars 2007 à 17:16
24 juil. 2008 à 00:23