public static LychrelCandidate ProcessLychrelCandidate(LychrelCandidate c) { bool isNotLychrel = false; int count = 0; BigInteger n = c.Number; while (!isNotLychrel && count < c.MaxIterations) { n = AddReverse (n); isNotLychrel = IsPalindrome (n.ToString ()); count++; } return new LychrelCandidate (c.Number, c.MaxIterations, count, isNotLychrel, n.ToString ()); }
public static LychrelCandidate ProcessLychrelCandidate(LychrelCandidate c) { bool isNotLychrel = false; int count = 0; BigInteger n = c.Number; while (!isNotLychrel && count < c.MaxIterations) { n = AddReverse(n); isNotLychrel = IsPalindrome(n.ToString()); count++; } return(new LychrelCandidate(c.Number, c.MaxIterations, count, isNotLychrel, n.ToString())); }
public static void Display(LychrelCandidate c) { Console.WriteLine (c.Number + " " + c.IterationsDone + " " + c.Result); }
public static void Display(LychrelCandidate c) { Console.WriteLine(c.Number + " " + c.IterationsDone + " " + c.Result); }