Skip to content

Instantly share code, notes, and snippets.

@yinwang0
Created April 27, 2016 22:56
Show Gist options
  • Save yinwang0/003db100b0aac991fd01f8fb9882f709 to your computer and use it in GitHub Desktop.
Save yinwang0/003db100b0aac991fd01f8fb9882f709 to your computer and use it in GitHub Desktop.
fib in C#
using System;
namespace ConsoleApplication
{
class Program
{
public static long fib(int n)
{
if (n < 2) {
return n;
} else {
return fib(n-1) + fib(n-2);
}
}
static void Main()
{
Console.WriteLine(fib(48));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment