Ejemplo n.º 1
0
        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());
            }
        }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
        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();
        }