C程序找零钱

C程序找零钱

在这个问题中,我们给定一个值n,我们想要找零n卢比,并且我们有n个硬币,每个硬币的面值从1到m不等。我们需要返回能够组成这个总和的方式的总数。

例子

Input : N = 6 ; coins = {1,2,4}. Output : 6 Explanation : The total combination that make the sum of 6 is : {1,1,1,1,1,1} ; {1,1,1,1,2}; {1,1,2,2}; {1,1,4}; {2,2,2} ; {2,4}.登录后复制