UVA-674 - Coin Change

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 相同題目:ZOJ-d253

題意概要

題目給定一個美金金額 ( cents),試問:總共有多少種硬幣組合的方式。例如:當 時,則可以有以下 種組合方式:( 亦是有一種組合方式)

  1. cent 硬幣與 cent 硬幣
  2. cent 硬幣與 cent 硬幣
  3. cent 硬幣與 cent 硬幣
  4. cent 硬幣

Input

The input file contains any number of lines, each one consisting of a number for the amount of money in cents.


Output

For each input line, output a line containing the number of different ways of making changes with the above types of coins.


Sample Input

11
26

Sample Output

4
13
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus