Today I started to learn Java to give you six denominations of 1, 5, 10, 20, 50, 100 yuan notes __ Online programming

Source: Internet
Author: User
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 (

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.