Bonjour

Je ne sais pas pourquoi la fonction retourne toujours la valeur 21!
t : tableau de n cases.
voici le code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function det_max ( t : tab; n, x : byte ): byte;
var
max : byte;
begin
if x = n then
	max := t[n]
else
	begin
 
		if t[x] < max then
			max := det_max(t, n, x+1 )
		else
			max := t[x];
	end;
end;