コード例 #1
0
        private static void Main()
        {
            Helper.ConsoleMio.Setup();

            Helper.ConsoleMio.PrintHeading("Task 7 Count Number Occurrences");

            int[] collection = Helper.GetCollectionFromUserChoice(0, 10000, 0, 1000).ToArray();

            Helper.ConsoleMio.WriteLine("Results: ", DarkGreen);
            if (collection.Length < MAGIC_CONSTANT)
            {
                SmallCollectionHandler(collection);
            }
            else
            {
                LargeCollectionHandler(collection);
            }

            Console.WriteLine("Completed...");
        }
コード例 #2
0
        private static void Main()
        {
            Helper.ConsoleMio.Setup();

            Helper.ConsoleMio.PrintHeading("Task 8 Find The Majorant In A Collection");

            int[] collection = Helper.GetCollectionFromUserChoice(0, 100, 5, 7).ToArray();

            Helper.ConsoleMio
            .WriteLine("Working with: ", DarkBlue)
            .WriteLine(string.Join(" ", collection), Black);

            int majorant;

            if (GetMajorant(collection, out majorant))
            {
                Helper.ConsoleMio.WriteLine($"The Majorant is: {majorant}", DarkGreen);
            }
            else
            {
                Helper.ConsoleMio.WriteLine("The collection doesn't have a majorant", DarkRed);
            }
        }