Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Y Fibonnoci
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { delegate T id<T>(T arg0); static id<T> Y<T>(id<id<T>> f) { //Y f = f ( Y f ) return x => f(Y(f))(x); } static id<id<T>> _<T>(id<id<T>> f) { return f; } public static void Main(string[] args) { var fib = _<int>(f => n => n < 3 ? n : f(n - 1) + f(n - 2)); Console.WriteLine(Y(fib)(5)); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
string.Format example
Gen inheritance test
4 Distinct Integer Custom Code Generator
Pramod
Readonly
Interface IEnumerable
Lab7
reverseandcheck
TuplaDivWriteHexa
binary search tree (insert, search, findmin, findmax, level-pre-in-post order traversals
stackse - search stackoverflow differently
Please log in to post a comment.