随笔 - 24  文章 - 0  评论 - 0  阅读 - 8190

1.29号英语翻译

题目来源:https://acs.jxnu.edu.cn/problem/HDU2069

重点词汇:

 

Coin Change

 1000ms  32768K

描述:

  Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.

  For example, if we have 11 cents, then we can make changes with one 10-cent coin and one 1-cent coin, or two 5-cent coins and one 1-cent coin, or one 5-cent coin and six 1-cent coins, or eleven   1-cent coins. So there are four ways of making changes for 11 cents with the above coins. Note that we count that there is one way of making change for zero cent.

  Write a program to find the total number of different ways of making changes for any amount of money in cents. Your program should be able to handle up to 100 coins.

  假设有 5 种硬币:50 美分、25 美分、10 美分、5 美分和 1 美分。 我们想用这些硬币换成给定数量的钱。

  例如,如果我们有 11 美分,那么我们可以用一枚 10 美分硬币和一枚 1 美分硬币,或者两枚 5 美分硬币和一枚 1 美分硬币,或者一枚 5 美分硬币和六枚 1- 美分硬币,或 11 个 1 美分硬币。 因此,

  用上述硬币兑换 11 美分有四种方法。 请注意,我们认为有一种零钱找零的方法。

  编写一个程序,找出以美分为单位的任何金额进行更改的不同方法的总数。 您的程序应该能够处理多达 100 个硬币。

输入:

  The input file contains any number of lines, each one consisting of a number ( ≤250 ) for the amount of money in cents.
  
  输入文件包含任意数量的行,每行由一个数字 (≤250) 组成,表示以美分为单位的金额。

输出:

  For each input line, output a line containing the number of different ways of making changes with the above 5 types of coins.
 
        对于每个输入行,输出一行,其中包含使用上述 5 种硬币进行找零的不同方式的数量。

样例输入:

11
26

样例输出:

4
13
posted on   咏江浪淘沙  阅读(173)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示