Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Leonardo-numbers/C-sharp/leonardo-numbers.cs
Normal file
17
Task/Leonardo-numbers/C-sharp/leonardo-numbers.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main() {
|
||||
Console.WriteLine(string.Join(" ", Leonardo().Take(25)));
|
||||
Console.WriteLine(string.Join(" ", Leonardo(L0: 0, L1: 1, add: 0).Take(25)));
|
||||
}
|
||||
|
||||
public static IEnumerable<int> Leonardo(int L0 = 1, int L1 = 1, int add = 1) {
|
||||
while (true) {
|
||||
yield return L0;
|
||||
(L0, L1) = (L1, L0 + L1 + add);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue