1
0

some sec fixes

This commit is contained in:
Debug_pro
2026-02-12 01:22:45 +03:00
parent 43d7845cf1
commit 72d7aa9575
4 changed files with 13 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ namespace Lab
long a = 1;
long b = 1;
List<long> list = new List<long>();
while (a < n) { list.Add(a); long next = a + b; a = b; b = next; }
while (a < n) { list.Add(a); if (long.MaxValue - a < b) break; long next = a + b; a = b; b = next; }
OutBox.Text = string.Join(", ", list);
InfoText.Text = $"Найдено чисел: {list.Count}.";