I know, the title cracks you up
Given an amount of money output the fewest number of coins make up that amount
0.1 1 dime 0.01 1 penny 0.28 1 quarter 3 penny 0.56 2 quarter 1 nickel 1 penny 1.43 5 quarter 1 dime 1 nickel 3 penny
- 100 cents in a dollar.
- The values of each type of coin is:
Built-ins which trivialize this task are not allowed.
Input is a decimal representing the dollar value of the total
- No need to pluralize
- Output should be
<#_of_coins> <coin type>
The only trailing whitespace allowed is a single trailing newline/space.
If there is zero of a coin type, that coin type should not be shown. E.g.
1 quarter not
1 quarter 0 dime 0 nickel 0 penny