static void Main() { Console.WriteLine("The fourth homework in geekbrains. Task 1"); string filename = @"C:\Users\Dasha\Desktop\GEEKBRAINS\GBrainCsharp\Homework4\Task2\Homework4\data1.txt"; if (File.Exists(filename)) { StaticClass args = new StaticClass(filename); //args.Output(); Console.WriteLine(args.CountOfThreeDenomPars()); } else { StaticClass args = new StaticClass(20); args.InitArray(); //args.Output(); Console.WriteLine(args.CountOfThreeDenomPars()); } }
private static void Init() { try { Helpers.Print( $"Количество пар элементов массива равняется {StaticClass.FindPair(StaticClass.GetArrayFromFile(), 3)}"); } catch (FileNotFoundException e) { Helpers.Print(e.Message); } catch (Exception e) { Helpers.Print(e.Message); } finally { Helpers.Pause(); } }
static void Main(string[] args) { //int[] array = new int[20]; //Random rnd = new Random(15); //for (int i = 0; i < array.Length; i++) //{ // array[i] = rnd.Next(-10000, 10000); // Console.Write($"{array[i]} "); //} //StaticClass.ChetPar(array); try { StaticClass.LoadFromFile("text.txt"); } catch (FileNotFoundException) { Console.WriteLine("Файл не найден"); } Console.ReadLine(); }