J'ai testé la fonction suivante pour calculer la somme des éléments d'une matrice mais ça n'a pas marché. Veuillez m'aider.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
function som(tab:ttab;i,j:integer):integer;
var m:integer;
begin
if (i=n) and (j=n) then     
 som:=tab[i,j]
 else if i<n then
       som:=tab[i,j]+ som(tab,i,j+1);
end;