static void Main(string[] args) { int sum = 0; List<int> numbers = new List<int>(); //1 is not sum for (int i = 0; i < 9999999; i++) { FifthPower pw = new FifthPower(i); if (pw.CalculateFifthPowerOfDigits() == i) { numbers.Add(i); } } foreach (var number in numbers) { sum += number; Console.WriteLine(number); } Console.WriteLine("sum: {0}", sum); Console.ReadLine(); }
public void TestMethod3() { FifthPower pw = new FifthPower(20); var result = pw.CalculateFifthPowerOfDigits(); Assert.AreEqual(32, result); }
public void TestMethod2() { FifthPower pw = new FifthPower(55); var result = pw.CalculateFifthPowerOfDigits(); Assert.AreEqual(6250, result); }