Advertisement
Guest User

Untitled

a guest
May 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.52 KB | None | 0 0
  1. let parzystePodzielnePrzez3 (lista:int list) =
  2.     let rec parzyste lista licznik =
  3.         match lista with
  4.         | [] -> licznik
  5.         | head :: tail -> parzyste tail (if head % 2 = 0 then (licznik + 1) else licznik)
  6.  
  7.     let rec podzielnePrzez3 lista licznik =
  8.         match lista with
  9.         | [] -> licznik
  10.         | head :: tail -> podzielnePrzez3 tail (if head % 3 = 0 then (licznik + 1) else licznik)
  11.     (parzyste lista 0, podzielnePrzez3 lista 0)
  12.  
  13. parzystePodzielnePrzez3 [1; 2; 3; 4; 5; 6; 7; 8; 9; 12]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement