Created
January 30, 2017 00:13
-
-
Save Fhernd/6f79d515f71e95fb954883499e4b139d to your computer and use it in GitHub Desktop.
Generar números de Fibonacci a partir de una solución en programación funcional.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<ulong> numsFibonacci = new List<ulong>(); | |
Enumerable.Range(0, 200) | |
.ToList() | |
.ForEach( | |
i => | |
{ | |
numsFibonacci.Add(i <= 1 ? 1 : | |
numsFibonacci[i - 2] + numsFibonacci[i - 1]); | |
} | |
); | |
numsFibonacci.Take(15).Dump("Primeros 15 Números Fibonacci"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment