Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let parzystePodzielnePrzez3 (lista:int list) =
- let rec parzyste lista licznik =
- match lista with
- | [] -> licznik
- | head :: tail -> parzyste tail (if head % 2 = 0 then (licznik + 1) else licznik)
- let rec podzielnePrzez3 lista licznik =
- match lista with
- | [] -> licznik
- | head :: tail -> podzielnePrzez3 tail (if head % 3 = 0 then (licznik + 1) else licznik)
- (parzyste lista 0, podzielnePrzez3 lista 0)
- parzystePodzielnePrzez3 [1; 2; 3; 4; 5; 6; 7; 8; 9; 12]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement