Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open System
- let vypocti (x:double) (y:double) =
- seq {yield "scitani", x+y;
- yield "odcitani", x-y;
- yield "nasobeni", x*y;
- yield "deleni", x/y}
- [<EntryPoint>]
- let main argv =
- let mutable again = true
- while again do
- printfn "Zadej dvě čísla po sobě:"
- let ok1, value1 = Double.TryParse(Console.ReadLine())
- let ok2, value2 = Double.TryParse(Console.ReadLine())
- if ok1 && ok2 then
- Seq.iter (fun (a,b) -> printfn "%s %f" a b) (vypocti value1 value2)
- again <- false
- Console.ReadKey() |> ignore
- else printfn "Zkus to znovu!"
- 0 // return an integer exit code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement