求大神解答,,很急很急
Emulate a vending machine. Calculate the number of dollars and coins required to express a given amount of change in dollars, 50, 20, 10 and 5 cent coins. For example, $9.85 would be $9, 1 x 50c, 1 x 20x and 1 x 5c coins.
Then modify it so that it also prints out the number of $1 and $2 coins.
模拟一个自动售货机。计算所需的美元硬币数量来表达一个给定数量的改变以美元,50、20、10、5分硬币。例如,将9美元,9.85美元1 x 50 c,1 x 20 x和1 x 5 c硬币。
然后修改它,它也会打印出$ 1,$ 2硬币的数量。//我估计这个题目的意识是说要写出9.85=1*9+1*0.5+1*0.2+1*0.05这样的格式,然后输出1美元和2美元的数量,可是我不会把他们拆开。求大神告知