예제 #1
0
        public void NSDTest2()
        {
            int a = 24;
            int b = 18;

            int expected = 6;
            int result   = Pocitadlo.NSD(a, b);

            Assert.AreEqual(expected, result, "NDS počítá blbě!");
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Vítejte v ultra super NSD kalkulačce!", Console.ForegroundColor);

            Console.ForegroundColor = ConsoleColor.White;

            int a = LoadNumber();
            int b = LoadNumber();

            try
            {
                int result = Pocitadlo.NSD(a, b);
                Console.WriteLine($"\nNSD {a} a {b} je {result}", Console.ForegroundColor);
            }
#pragma warning disable 168
            catch (ArgumentException ex)
            {
                Console.WriteLine($"\nNSD {a} a {b} není definován", Console.ForegroundColor);
            }
#pragma warning restore 168

            Console.ReadKey();
        }