Problem
There are five kinds of coins, valuing 1, 5, 10, 25, 50.Given a integer and use these five kinds of coins to conbine.Each kind of coins is infinit but the sum of coins to sum up the integer mustn’t exceeding 100.Futhermore, the given integer is smaller than 250.The question is that how many methods we can sum up the integer with the five kinds of coins.
Input Formal
There is one integer each line represents the value we want to sum up.
Implements
we should add one demension to record the number of methods in each condition with different num of coins and add a loop to limit the num of coins.
At the end of the program, we should sum up the num of methods with different num of coins but having the same value.
Samples
Inputs:
0
11
26
50
100
200
249
250
Outputs:
1
12
39
149
803
5135
7347
3830
Traditional Methods
|
|