Advertisement
Guest User

Untitled

a guest
Jan 25th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.78 KB | None | 0 0
  1. //F# Compiler for F# 4.0 (Open Source Edition), Mono 4.2.1
  2.  
  3. open System
  4.  
  5. let funkcja(znak : char)(text : string) =
  6.     let mutable temp = 0
  7.     for i in text do
  8.         if i = znak then
  9.             temp <- temp + 1
  10.     temp;;
  11.        
  12. let wynik = funkcja('x')("xaxxa");;
  13.  
  14.  
  15. type ksiazka = {tytul: string; autor: string; rok_wydania: int}
  16.  
  17.  
  18. let k1 = {tytul = "Potop"; autor = "Sienkiewicz"; rok_wydania = 1995}
  19. let k2 = {tytul = "Dupsko"; autor = "Rzydek"; rok_wydania = 1994}
  20. let k3 = {tytul = "Kapcioch"; autor = "Henryk"; rok_wydania = 1993}
  21.  
  22. let funkcjaLista(lista : float list) =
  23.     let mutable temp = 0.0
  24.     for i in lista do
  25.         temp<- temp + i
  26.     temp;;
  27.  
  28. let wynikListy = funkcjaLista([1.1;2.0]);;
  29.  
  30.  
  31. printfn "%d" wynik
  32. printfn "%.2f" wynikListy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement