Find minimum number of coins that make a given value: Difference between revisions
Find minimum number of coins that make a given value (view source)
Revision as of 09:01, 27 October 2022
, 1 year ago→{{header|FutureBasic}}
No edit summary |
|||
Line 406:
fn MinimumCoinsForValue( 1024, @[@1, @2, @5, @10, @20, @50, @100, @200] )
print : print
print "Currency in this example represents U.S. denominations:"
fn MinimumCoinsForValue( 65273, @[@1, @2, @5, @10, @20, @50, @100, @200] )▼
print " 1 cent, 5 cents, 10 cents, 25 cents, 50 cents, $1, $5, $10, $20, $50"
▲fn MinimumCoinsForValue( 65273, @[@1
HandleEvents
Line 429 ⟶ 431:
Currency in this example represents U.S. denominations:
The minimum number of coins valued 1, 2, 5, 10, 20, 50, 100, 200 needed to total 65273 is:▼
1 cent, 5 cents, 10 cents, 25 cents, 50 cents, $1, $5, $10, $20, $50
▲The minimum number of coins valued 1
13 * 5000
1 * 50
▲1 * 1
</pre>
=={{header|Go}}==
|