Пример #1
0
        static void Main(string[] args)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();
            //Console.WriteLine(Problems.ExecuteProblem(1));
            Console.WriteLine(Problems.ExecuteProblem(2));
            //Console.WriteLine(Problems.ExecuteProblem(3));
            sw.Stop();
            Console.WriteLine($"Completed in {sw.ElapsedTicks} ticks, which is {sw.ElapsedMilliseconds} ms");
            sw.Restart();
            Console.WriteLine(Problems.ExecuteProblem(4));
            Console.WriteLine($"Completed in {sw.ElapsedTicks} ticks, which is {sw.ElapsedMilliseconds} ms");
            sw.Stop();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var start = DateTime.Now;

            Console.WriteLine("Problem 2: " + Problems.Problem2());
            Console.WriteLine("Took " + (DateTime.Now - start).TotalMilliseconds + "ms to solve");

            //Console.WriteLine("Problem 1: " + Problems.Problem1());
            //Console.WriteLine("Problem 2: " + Problems.Problem2());
            //Console.WriteLine("Problem 3: " + Problems.Problem3());
            //Console.WriteLine("Problem 4: " + Problems.Problem4());
            //Console.WriteLine("Problem 5: " + Problems.Problem5());
            //Console.WriteLine("Problem 6: " + Problems.Problem6());
            //Console.WriteLine("Problem 7: " + Problems.Problem7());
            //Console.WriteLine("Problem 9: " + Problems.Problem9());
            //Console.WriteLine("Problem 10: " + Problems.Problem10());
            Console.Read();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.Out.Write("Problem Number : ");
            int problem = Int32.Parse(Console.ReadLine());

            Problems p = new Problems();

            Stopwatch watch = new Stopwatch();

            watch.Start();
            long res = p.Problem(problem);

            watch.Stop();

            Console.Out.WriteLine("Result : " + res.ToString() + " in " + watch.ElapsedMilliseconds + " ms");

            Clipboard.SetText(res.ToString());

            Console.ReadLine();
        }
Пример #4
0
        public Menu()
        {
            currentSelectedIndex = 0;

            menuItems = new string[]
            {
                "Problem 1 - Multiples of 3 and 5",
                "Problem 2 - Even Fibonacci Numbers",
                "Problem 3 - Largest Prime Factor",
                "Problem 4 - Largest Palidrome Product",
                "Problem 5 - Smallest Multiple",
                "Problem 6 - Sum Square Difference",
                "Problem 7 - 10001st Prime Number",
                "Problem 8 - Largest Product in a Series",
                "Problem 9 - Special Pythagrean Triplet",
                "Problem 10 - Summation of Primes"
            };

            max      = menuItems.Length - 1;
            problems = new Problems();
        }
Пример #5
0
        static void Main(string[] args)
        {
            var p = new Problems();

            p.Problem20();
        }