0
Does anyone knows here how to make a breakdown of money?
Example input: 4568.25 Output: 1000: 4 pcs 500: 1 pc 200: 100: 50: 1 pc 20: 10: 5: 1 pc 1: 4 pc 25 cents: 1 pc 5 cents:
1 Respuesta
+ 2
You can store all of the 'coins' in an array, and then keep executing it in a for loop, ising floor division to get how many coins you need, and then continur with the remainder.