public static void Main() { WriteLine("Problem 4"); int maxPalindrome = Problem4.Solve(); WriteLine($"maxPalindrome = {maxPalindrome}"); }
static void Main(string[] args) { string[] lines = System.IO.File.ReadAllLines(@"C:\Users\rares.ghencioiu\Documents\Visual Studio 2013\Projects\ConsoleApplication1\problem4words.txt"); Problem4 p = new Problem4(); for (int i = 0; i < lines.Length; i++) { char[] arr = lines[i].ToCharArray(); p.perm(arr); Console.WriteLine(); } }
static void Main(string[] args) { Problem4 p4 = new Problem4(); int max = 0; int num; for (int i = 999; i > 99; i--) { for (int j = 999; j > 99; j--) { num = i * j; if (num == p4.ReverseInt(num)) { if (num > max) { max = num; } } } } Console.WriteLine(max); }