correct mistake

This commit is contained in:
Arkitu 2025-11-14 09:15:10 +01:00
parent afbe9492bf
commit 9419d6600a
2 changed files with 9 additions and 9 deletions

View File

@ -1,10 +1,10 @@
let plusetfois a b = (a+b, a*b);;
let rec pp2_h n = match n with
let rec ppp2_h n = match n with
| 0 -> 1
| _ -> 2 * (pp2_h (n/2))
| _ -> 2 * (ppp2_h (n/2))
let pp2 n = if n == 0 then 0 else pp2_h (n-1)
let ppp2 n = if n == 0 then 0 else ppp2_h (n-1)
let leeloo l = match l with
| _::_::_::_::a::_ -> a
@ -43,4 +43,4 @@ let rec lexico la lb = match la, lb with
let rec aplatir l = match l with
| [] -> []
| []::ql -> aplatir ql
| (a::q)::ql -> a::(aplatir (q::ql))
| (a::q)::ql -> a::(aplatir (q::ql))

View File

@ -2,10 +2,10 @@ open Lib;;
assert (plusetfois 5 6 = (11, 30));;
assert (pp2 10 = 16);;
assert (pp2 32 = 32);;
assert (pp2 1 = 1);;
assert (pp2 0 = 0);;
assert (ppp2 10 = 16);;
assert (ppp2 32 = 32);;
assert (ppp2 1 = 1);;
assert (ppp2 0 = 0);;
assert (leeloo [2; 65; 2; 3; 7; 2] = 7);;
@ -32,4 +32,4 @@ assert (aplatir [[1; 2]; [3; 4]] = [1; 2; 3; 4]);;
assert (aplatir [[]; [3; 4]] = [3; 4]);;
assert (aplatir [] = []);;
assert (aplatir [[]] = []);;
assert (aplatir [[]; []] = []);;
assert (aplatir [[]; []] = []);;