Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. let numberOfSolution(a:float32, b:float32, c:float32): int=
  2. let delta = (b*b)-(float32(4)*(a*c))
  3. if delta < float32(0) then 0
  4. elif delta = float32(0) then 1
  5. else 2
  6. let main() =
  7. seq { while true do yield stdin.ReadLine () }
  8. |> Seq.takeWhile ((<>) null)
  9. |> Seq.map (fun x -> x.Split(" "))
  10. |> Seq.iter (fun x -> System.Console.WriteLine(numberOfSolution(float32(x.[0]), float32(x.[1]), float32(x.[2]))))
  11. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement