public void GetExistVampireNumber_Test() { List <int> actual = VampireNumber.GetExistVampireNumber(4); List <int> expected = new List <int>() { }; CollectionAssert.AreEqual(expected, actual); }
private void task1(object sender, RoutedEventArgs e) { textBox_unsver.Text = ""; //1 vampire number List <int> vn = VampireNumber.GetExistVampireNumber(4); //vn.ForEach(value => textBox_unsver.Text += value); for (int i = 0; i < vn.Count; i += 3) { textBox_unsver.Text += vn.ElementAt(i) + " = " + vn.ElementAt(i + 1) + " * " + vn.ElementAt(i + 2) + "\n"; } textBox_task.Text = "1. A vampire number has an even number " + "of digits and is formed by multiplying a pair of numbers " + "containing half the number of digits of the result. The digits" + " are taken from the original number in any order. Pairs of " + "trailing zeroes are not allowed. Examples include: 1260 = 21 * " + "60 1827 = 21 * 87 2187 = 27 * 81 Write a program that finds all " + "the 4-digit vampire numbers"; }