问个简单的编程作业,小弟是新手,希望各位兄弟帮帮我。跪求答案啊。。。我要死了
Task 1: Coin-Changing You will write a coin-changing program for lab1. First, ask the user for the amount in
Hong Kong dollars, such as 56.30. Then find the minimum number of $10, $5, $2, $1, 50 cent, 20 cent, and 10 cent coins to give in return.
For example, your program first prompts the user for the amount in HKD by displaying the following message.
Please input the amount in Hong Kong dollars:
If the input is 56.30, the output should be
10-dollar coin: 5
5-dollar coin: 1
2-dollar coin: 0
1-dollar coin: 1
50-cent coin: 0
20-cent coin: 1
10-cent coin: 1
希望各位兄弟帮帮我。。这个应该怎么编写啊。。。
最好整个写出来。。。谢谢了!
[[it] 本帖最后由 a2339923 于 2008-10-23 17:43 编辑 [/it]]