示例#1
0
 static void Main(string[] args)
 {
     //Console.WriteLine("Hello World!");
     Display(nameof(Solutions.Solution1), Solutions.Solution1(1000));
     Display(nameof(Solutions.Solution2), Solutions.Solution2(4000000));
     Console.ReadLine();
 }
示例#2
0
        private static void Main()
        {
            var sw = new Stopwatch();

            sw.Start();
            Console.WriteLine(Solutions.Problem504());
            sw.Stop();
            Console.WriteLine("Elapsed time: {0} ms", sw.ElapsedMilliseconds);
            Console.ReadLine();
        }
示例#3
0
        /// <summary>
        /// Entry point for the project.
        /// </summary>
        public static void Main()
        {
            Console.WriteLine("Which problem would you like to check?");
            string rl = Console.ReadLine();

            if (rl == "t")
            {
                Test();
            }
            else
            {
                int        problem = int.Parse(rl);
                Type       type    = typeof(Solutions);
                MethodInfo method  = type.GetMethod($"Problem{problem}");
                Solutions  c       = new Solutions();
                var        result  = method.Invoke(c, null);
                Console.WriteLine($"\nProblem {problem}: {JsonConvert.SerializeObject(result)}\n\n");
            }
        }
示例#4
0
 public void Setup()
 {
     solution = new ProjectEuler.Solutions();
 }
示例#5
0
 public void Problem65Test()
 {
     Assert.AreEqual(272, Solutions.Problem65());
 }
示例#6
0
 public void Problem63Test()
 {
     Assert.AreEqual(49, Solutions.Problem63());
 }
示例#7
0
 public void Problem59Test()
 {
     Assert.AreEqual(107359, Solutions.Problem59());
 }
示例#8
0
 public void Problem52Test()
 {
     Assert.AreEqual(142857, Solutions.Problem52());
 }
示例#9
0
 public void Proble112Test()
 {
     Assert.AreEqual(1587000, Solutions.Problem112());
 }
示例#10
0
 public void Proble102Test()
 {
     Assert.AreEqual(228, Solutions.Problem102());
 }
示例#11
0
 public void Problem81Test()
 {
     Assert.AreEqual(427337, Solutions.Problem81());
 }
示例#12
0
 public void Problem80Test()
 {
     Assert.AreEqual(40886, Solutions.Problem80());
 }
示例#13
0
 public void Problem79Test()
 {
     Assert.AreEqual("73162890", Solutions.Problem79());
 }
示例#14
0
 public void Problem78Test()
 {
     Assert.AreEqual(55374, Solutions.Problem78());
 }
示例#15
0
 public void Problem77Test()
 {
     Assert.AreEqual(71, Solutions.Problem77());
 }
示例#16
0
 public void Problem75Test()
 {
     Assert.AreEqual(161667, Solutions.Problem75());
 }
示例#17
0
 public void Proble100Test()
 {
     Assert.AreEqual(756872327473, Solutions.Problem100());
 }
示例#18
0
 public void Problem82Test()
 {
     Assert.AreEqual(260324, Solutions.Problem82());
 }
示例#19
0
 public void Proble104Test()
 {
     Assert.AreEqual(329468, Solutions.Problem104());
 }
示例#20
0
 public void Problem83Test()
 {
     Assert.AreEqual(425185, Solutions.Problem83());
 }
示例#21
0
 public void Proble205Test()
 {
     Assert.AreEqual(0.5731441m, Solutions.Problem205());
 }
示例#22
0
 public void Problem87Test()
 {
     Assert.AreEqual(1097343, Solutions.Problem87());
 }
示例#23
0
 public void Problem53Test()
 {
     Assert.AreEqual(4075, Solutions.Problem53());
 }
示例#24
0
 public void Problem89Test()
 {
     Assert.AreEqual(743, Solutions.Problem89());
 }
示例#25
0
 public void Problem62Test()
 {
     Assert.AreEqual(127035954683, Solutions.Problem62());
 }
示例#26
0
 public void Problem92Test()
 {
     Assert.AreEqual(8581146, Solutions.Problem92());
 }
示例#27
0
 public void Problem64Test()
 {
     Assert.AreEqual(1322, Solutions.Problem64());
 }
示例#28
0
 public void Problem96Test()
 {
     Assert.AreEqual(24702, Solutions.Problem96());
 }
示例#29
0
 public static void Test()
 {
     Console.WriteLine(Solutions.Factorial(0));
     Console.WriteLine(Solutions.Choose(5, 3));
 }
示例#30
0
 public void Problem97Test()
 {
     Assert.AreEqual("8739992577", Solutions.Problem97());
 }
示例#31
0
 public void Proble99Test()
 {
     Assert.AreEqual(709, Solutions.Problem99());
 }
示例#32
0
 static void Main(string[] args)
 {
     var solutions = new Solutions();
     Console.WriteLine(String.Format("Answer to Problem 12 = {0}", solutions.Problem012()));
     Console.ReadKey();
 }