First Commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"fsautocomplete": {
|
||||
"version": "0.51.0",
|
||||
"commands": [
|
||||
"fsautocomplete"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
// Modules
|
||||
open System
|
||||
|
||||
// Recursive definition of Fibonacci numbers
|
||||
let rec fib n =
|
||||
match n with
|
||||
| 0 -> 0
|
||||
| 1 -> 1
|
||||
| _ -> fib (n-1) + fib (n-2)
|
||||
|
||||
// Read from stdin and print result
|
||||
printfn "Inserisci l'indice del numero di fibonacci che vuoi calcolare:\n"
|
||||
let i = Console.ReadLine() |> int
|
||||
printfn "%A" (fib (i))
|
||||
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user