예제 #1
0
        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 ());
        }
예제 #2
0
        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()));
        }
예제 #3
0
 public static void Display(LychrelCandidate c)
 {
     Console.WriteLine (c.Number + " " + c.IterationsDone + " " + c.Result);
 }
예제 #4
0
 public static void Display(LychrelCandidate c)
 {
     Console.WriteLine(c.Number + " " + c.IterationsDone + " " + c.Result);
 }