You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
327 B
Forth

// Modules
open System
// Recursive definition
let rec mc91 n =
if n > 100 then
n - 10
else
mc91 (mc91 (n + 11))
// Ask for input
printfn "Inserisci l'intero in cui calcolare la funzione 91 di McCarthey:\n"
let i = Console.ReadLine() |> int
// Print result
printfn "%d" (mc91 (i))