Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.31 KB | None | 0 0
  1.  (*ZADANIE 6********** *)
  2.  
  3. let rec krotnosc x ys ilosc=
  4.     match ys with
  5.     | [] -> ilosc
  6.     | ysh::yst -> if ysh = x then krotnosc x yst ilosc+1
  7.                   else krotnosc x yst ilosc
  8.  
  9. [<EntryPoint>]
  10. let main _ =
  11.     let x = [1; 1; 1; 3; 3; 2; 1];
  12.     printfn "ilosc to %A" (krotnosc 1 x 0);
  13.     0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement