Give you six denominations of 1, 5, 10, 20, 50, 100 yuan of paper money, assuming that the number of each currency is enough, write the program to find the composition of N (n is 0~10000 of the nonnegative integer) of the number of different combinations.
Enter a description:
Input includes an integer n (1≤n≤10000)
Output Description:
Output An integer that represents the number of different combination schemes
Enter Example 1:
1
Output Example 1:
1
This is a big guy on the internet to give the analysis, feeling is a recurring problem.
Import Java.util.Scanner; public class main{ public static void Main (string[] args) { Scanner SC = new Scanner (system.in); while (Sc.hasnext ()) { int n = sc.nextint (); System.out.println (count (n)); } } public static Long Count (int n) { if (n<= 0) return 0; &nb sp; long [] DP = New Long [n+ 1]; dp[0] = 1; //Here int[] never less [] this bracket ... int []coins = new INT []{1, 5, 10, 20, 50, 100}; for (