1
0
This commit is contained in:
Debug_pro
2026-02-12 01:01:44 +03:00
commit 43d7845cf1
23 changed files with 1353 additions and 0 deletions

49
FibonacciWindow.xaml.cs Normal file
View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Lab
{
/// <summary>
/// Interaction logic for FibonacciWindow.xaml
/// </summary>
public partial class FibonacciWindow : Window
{
private void ClickBack(object sender, RoutedEventArgs e) => Close();
private void ClickCalc(object sender, RoutedEventArgs e)
{
OutBox.Text = "";
InfoText.Text = "";
if (!Parsers.TryParseInt(NBox.Text, out int n) || n <= 0) {
InfoText.Text = "Введите целое N, N > 0.";
return;
}
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; }
OutBox.Text = string.Join(", ", list);
InfoText.Text = $"Найдено чисел: {list.Count}.";
}
public FibonacciWindow()
{
InitializeComponent();
}
}
}