public void SumOfAllTheMultiplesOf3And5Below10Is23() { // 3+5+6+9 = 23 Problem001 p1 = new Problem001(); Assert.AreEqual(23, p1.SumOfAllTheMultiplesOfTwoIntegersBelowCeiling(3, 5, 10)); }
public void SumOfAllTheMultiplesOf2And3Below10Is38() { // 2+3+4+6+8+9 = 32 Problem001 p1 = new Problem001(); Assert.AreEqual(32, p1.SumOfAllTheMultiplesOfTwoIntegersBelowCeiling(2, 3, 10)); }
public void SumOfAllTheMultiplesOf3And5Below1000IsUnknown() { Problem001 p1 = new Problem001(); Assert.AreEqual(233168, p1.SumOfAllTheMultiplesOfTwoIntegersBelowCeiling(3, 5, 1000)); }
static void Main() { Console.WriteLine("Enter a number to run the Project Euler problem"); Console.WriteLine("001 - Multiples of 3 and 5"); Console.WriteLine("002 - Even Fibonacci numbers"); Console.WriteLine("003 - Largest prime factor"); Console.WriteLine("004 - Largest palindrome product"); Console.WriteLine("005 - Smallest multiple"); Console.WriteLine("006 - Sum square difference"); Console.WriteLine("007 - 10001st prime"); Console.WriteLine("008 - Largest product in a series"); Console.WriteLine("009 - Special Pythagorean triplet"); Console.WriteLine("010 - Summation of primes"); Console.WriteLine("0 to Exit"); switch (Convert.ToInt32(Console.ReadLine())) { case 1: Problem001.Solution(); break; case 2: Problem002.Solution(); break; case 3: Problem003.Solution(); break; case 4: Problem004.Solution(); break; case 5: Problem005.Solution(); break; case 6: Problem006.Solution(); break; case 7: Problem007.Solution(); break; case 8: Problem008.Solution(); break; case 9: Problem009.Solution(); break; case 10: Problem010.Solution(); break; case 0: System.Environment.Exit(1); break; default: Console.WriteLine("Invalid input. Please try again."); break; } Main(); }