Siriuslight's blog

By Siriuslight, history, 6 years ago, In English

I implemented a code for Problem 55 of Project Euler. It is giving me an incorrect answer. This my code.

Can anyone help me, to find the bug?

THOSE WHO DID NOT SOLVE IT, PLEASE DO NOT OPEN THE CODE. IT WILL BE A SPOILER.

  • Vote: I like it
  • -18
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Siriuslight (previous revision, new revision, compare).

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Siriuslight (previous revision, new revision, compare).

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Siriuslight (previous revision, new revision, compare).

»
6 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Read the question carefully:

"Surprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994."

for(int i = 0; i <= 50; ++i){
  v = add(v); 
  if(palin(v)) return 0;
}
  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You mean to say that, the numbers which are initially palindrome will be performed with operation first, then checking palindrome condition.