Advertisement
Guest User

Untitled

a guest
May 24th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.32 KB | None | 0 0
  1. let rec srednia_geometryczna (ilosc:int) (suma:double) =
  2.     let znak = System.Console.Readline()
  3.     let wartosc = System.Convert.ToDouble(znak)
  4.     if wartosc = 0.0 then (
  5.         if ilosc <> 0 then (suma, System.Math.Pow(suma, (1.0 / double ilosc)))
  6.                         else (0.0, System.Double.NaN)
  7.                         )
  8.     else srednia (ilosc + 1) (suma + wartosc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement