Advertisement
EmhyrVanEmrias

Untitled

Jan 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. let rec dodawanie n x w=
  2. match n with
  3. | 0->w
  4. |_->dodawanie (n-1) x (w+x)
  5.  
  6. dodawanie 3 4 0
  7.  
  8.  
  9.  
  10. let segregowanie lista=
  11. lista |> List.filter(fun x->x>5)
  12. segregowanie [1..10]
  13. let rec zad1 list=
  14. match list with
  15. | []->None
  16. |x::[] -> Some(x)
  17. |x::xs ->zad1 xs
  18. zad1 [1..10]
  19. let rec nierosnacy lista=
  20. match lista with
  21. |[]->true
  22. |x::xs->
  23. match xs with
  24. |x1::_ ->
  25. if(x1>x) then false
  26. else nierosnacy xs
  27.  
  28. nierosnacy[1..10]
  29. nierosnacy [10;2;3;4;5;1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement