diff --git a/ulohyfs/src/u22.fs b/ulohyfs/src/u22.fs new file mode 100644 index 0000000..4a98608 --- /dev/null +++ b/ulohyfs/src/u22.fs @@ -0,0 +1,17 @@ +module UlohyFs.u22 + +open System.IO +open System.Text.Unicode +open UlohyFs.Attributes +open System + +[] +let uloha22() = + printfn "zadaj dajake cislo" + let input = Console.ReadLine() + let inpint = int input + input.ToString() + |> Seq.map (fun x -> x.ToString()) + |> Seq.map (fun x -> int x) + |> Seq.sum + |> printfn "sum: %d" \ No newline at end of file diff --git a/ulohyfs/src/u23.fs b/ulohyfs/src/u23.fs new file mode 100644 index 0000000..30dc6d0 --- /dev/null +++ b/ulohyfs/src/u23.fs @@ -0,0 +1,25 @@ +module UlohyFs.u23 + +open System.IO +open System.Text.Unicode +open UlohyFs.Attributes +open System + +[] +let uloha23() = + let mutable array4 = Array.create 4 0.0 + let mutable i = 0 + let mutable running = true + while running do + printfn "Zadaj dajake cislo alebo koniec" + let inp = Console.ReadLine() + if inp = "end" || inp = "koniec" then + running <- false + else + array4.[i] <- float inp + i <- i + 1 + if i = 3 then + array4.[i] <- float inp + printfn "pole: %A" array4 + array4 |> Array.average |> printfn "priemer: %f" + i <- 0 \ No newline at end of file diff --git a/ulohyfs/ulohyfs.fsproj b/ulohyfs/ulohyfs.fsproj index 96116b9..2b4a4bd 100644 --- a/ulohyfs/ulohyfs.fsproj +++ b/ulohyfs/ulohyfs.fsproj @@ -6,10 +6,16 @@ UlohyFs + + + + + +