22 23
This commit is contained in:
parent
3db57eabca
commit
052267d143
3 changed files with 48 additions and 0 deletions
17
ulohyfs/src/u22.fs
Normal file
17
ulohyfs/src/u22.fs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
module UlohyFs.u22
|
||||||
|
|
||||||
|
open System.IO
|
||||||
|
open System.Text.Unicode
|
||||||
|
open UlohyFs.Attributes
|
||||||
|
open System
|
||||||
|
|
||||||
|
[<Uloha(22)>]
|
||||||
|
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"
|
25
ulohyfs/src/u23.fs
Normal file
25
ulohyfs/src/u23.fs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
module UlohyFs.u23
|
||||||
|
|
||||||
|
open System.IO
|
||||||
|
open System.Text.Unicode
|
||||||
|
open UlohyFs.Attributes
|
||||||
|
open System
|
||||||
|
|
||||||
|
[<Uloha(23)>]
|
||||||
|
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
|
|
@ -6,10 +6,16 @@
|
||||||
<RootNamespace>UlohyFs</RootNamespace>
|
<RootNamespace>UlohyFs</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="SDL3.Core" Version="1.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="src\Attributes.fs" />
|
<Compile Include="src\Attributes.fs" />
|
||||||
<Compile Include="src\u16.fs" />
|
<Compile Include="src\u16.fs" />
|
||||||
<Compile Include="src\u15.fs" />
|
<Compile Include="src\u15.fs" />
|
||||||
|
<Compile Include="src\u22.fs" />
|
||||||
|
<Compile Include="src\u23.fs" />
|
||||||
<Compile Include="src\u17.fs" />
|
<Compile Include="src\u17.fs" />
|
||||||
<Compile Include="src\u18.fs" />
|
<Compile Include="src\u18.fs" />
|
||||||
<Compile Include="src\u19.fs" />
|
<Compile Include="src\u19.fs" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue