-->
当前位置:首页 > 题库

PROGRAMMING:exchange coins

Luz5年前 (2021-05-10)题库399
How many different ways can I change a sum of change into 5, 2 and 1 cent coins?
###Input format:
Enter the amount of change to be changed in one line $$X / in (8, 100) $.
###Output format:
It is required to output various exchange methods according to the number of 5 cents, 2 cents and 1 cent coins from large to small. Each line output a change, the format is: "fen5: 5 cents, fen2: 2 cents, Fen1: 1 cents, total: the total number of coins". The last line outputs "count = number of substitution".
###Input example:
```in
thirteen
```
###Output example:
```out
fen5:2, fen2:1, fen1:1, total:4
fen5:1, fen2:3, fen1:2, total:6
fen5:1, fen2:2, fen1:4, total:7
fen5:1, fen2:1, fen1:6, total:8
count = 4
```






answer:If there is no answer, please comment