Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //F# Compiler for F# 4.0 (Open Source Edition), Mono 4.2.1
- open System
- let funkcja(znak : char)(text : string) =
- let mutable temp = 0
- for i in text do
- if i = znak then
- temp <- temp + 1
- temp;;
- let wynik = funkcja('x')("xaxxa");;
- type ksiazka = {tytul: string; autor: string; rok_wydania: int}
- let k1 = {tytul = "Potop"; autor = "Sienkiewicz"; rok_wydania = 1995}
- let k2 = {tytul = "Dupsko"; autor = "Rzydek"; rok_wydania = 1994}
- let k3 = {tytul = "Kapcioch"; autor = "Henryk"; rok_wydania = 1993}
- let funkcjaLista(lista : float list) =
- let mutable temp = 0.0
- for i in lista do
- temp<- temp + i
- temp;;
- let wynikListy = funkcjaLista([1.1;2.0]);;
- printfn "%d" wynik
- printfn "%.2f" wynikListy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement