Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Re: Trying 3 different ways to do the same thing, each one is wrong

    Problem with this is that ints in java are signed. max= 2147483647 (2^31 -1)
  2. Re: Trying 3 different ways to do the same thing, each one is wrong

    Can you describe what happens?

    As a suggestion for debugging your algorithm, use a smaller number such as 5 to validate the code works, then change to the larger number. Less debug output and...
  3. Re: Trying 3 different ways to do the same thing, each one is wrong

    Thanks for the reply. Its been a long time since college and set theory.
  4. Re: Trying 3 different ways to do the same thing, each one is wrong

    Better re-read definition of the for loop conditioni part. The loop continues if the condition is true.
    Your huge && condition tests true when? and false when?
  5. Re: Trying 3 different ways to do the same thing, each one is wrong

    Another comment on the code: Its hardcoded to solve the problem for 20.
    Try to write the code so it will solve the problem for any number x.

    @hellowordl922
    Could you explain how you get these...
  6. Re: Trying 3 different ways to do the same thing, each one is wrong

    Can you explain the algorithm(s) that you want to use?

    Can you explain a bit more? Or show the output and explain why its wrong.
Results 1 to 6 of 6