Advertisement
Guest User

Untitled

a guest
May 20th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.40 KB | None | 0 0
  1. [<EntryPoint>]
  2. let main argv =
  3.      
  4.     printf "Iveskite Fibinacio skaiciu sekos ilgi: "
  5.     let ilgis = System.Console.ReadLine() |> int
  6.  
  7.     let rec fib n1 n2 a =  // 3, 5 -> 5, 8
  8.         if a > 0 then
  9.             printfn "%d : %d" (ilgis-a) (n1)
  10.             fib (n2) (n1+n2) (a-1)
  11.             else
  12.                 n1
  13.  
  14.     let sk = fib 0 1 ilgis
  15.  
  16.     printfn "%d narys yra: %d \n" ilgis sk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement