static IEnumerable<int> Fibs(int count) { for (int i = 0,prevFib=1,curFib=1; i < count; i++) { yield return prevFib; int newFib = prevFib + curFib; prevFib = curFib; curFib = newFib; } }
2021-07-09 12:59:34
static IEnumerable<int> Fibs(int count) { for (int i = 0,prevFib=1,curFib=1; i < count; i++) { yield return prevFib; int newFib = prevFib + curFib; prevFib = curFib; curFib = newFib; } }