Search:

Type: Posts; User: helloworld922

Search: Search took 0.11 seconds.

  1. Re: Improving the code to produce the same program

    The greedy method (using modulo/division):

    1. Start with the current denomination = largest denomination available
    2. amount of current denomination = amount / current denomination (note: using...
  2. Re: Improving the code to produce the same program

    Yep, no loops should be required (luckily, most monetary systems aren't NP-hard, which can't be said for the general case). In addition to division and modulus, you'll also need addition/subtraction.
Results 1 to 2 of 2