18 lines
339 B
Text
18 lines
339 B
Text
using System;
|
|
using System.Console;
|
|
|
|
module Fibonacci
|
|
{
|
|
Fibonacci(x : long) : long
|
|
{
|
|
|x when x < 2 => x
|
|
|_ => Fibonacci(x - 1) + Fibonacci(x - 2)
|
|
}
|
|
|
|
Main() : void
|
|
{
|
|
def num = Int64.Parse(ReadLine());
|
|
foreach (n in $[0 .. num])
|
|
WriteLine("{0}: {1}", n, Fibonacci(n));
|
|
}
|
|
}
|