Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.63 KB | None | 0 0
  1. // Learn more about F# at http://fsharp.org
  2. // See the 'F# Tutorial' project for more help.
  3.  
  4.  
  5. let rec dlugosc l suma =
  6.     match l with
  7.     | [] -> suma
  8.     | x::xs -> dlugosc xs suma+1
  9.  
  10. let rec krotnosc x ys ilosc=
  11.     match ys with
  12.     | [] -> ilosc
  13.     | ysh::yst -> if ysh = x then krotnosc x yst ilosc+1
  14.                   else krotnosc x yst ilosc    
  15.  
  16. let rec powtorzenia l1 l2 =
  17.    match l1 with
  18.    | [] -> l2
  19.    | x::xs -> if
  20.  
  21.  
  22.  
  23. [<EntryPoint>]
  24. let main argv =
  25.     let l = [2; 4; 5; 6; 2; 9; 10];
  26.     //printfn "%A" (dlugosc l 0);
  27.     //printfn "%A" (krotnosc 2 l 0);
  28.  
  29.  
  30.     0 // return an integer exit code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement