using System;
using System.Collections.Generic;
namespace MyCompiler
{
class Program
{
private static int Fib(int n)
{
if (n < 1) { return 0; }
if (n < 3) { return 1; }
var memo = new Dictionary<int, int>();
if (!memo.ContainsKey(n))
{
memo[n] = Fib(n - 1) + Fib(n - 2);
}
return memo[n];
}
public static void Main(string[] args)
{
for (int i = 0; i < 15; i++)
{
Console.WriteLine(Fib(i));
}
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: