TORONTO KIDS COMPUTER CLUB | PMCA Sunday 12:00 Java Homework 20.02.02.
17034
post-template-default,single,single-post,postid-17034,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Sunday 12:00 Java Homework 20.02.02.

06 Feb PMCA Sunday 12:00 Java Homework 20.02.02.

Question:
Let’s say you have 4 coins each worth 1$, 2$ , 5$ and 10$. You have to find the number of ways you can give him N dollars change. N is a whole number.

Sample Input 1: 
1

Sample Output 1:
1

Explanation:
You can give him only one 1$ coin


Sample Input 2: 
2

Sample Output 2: 
2

Explanation:
You can give him three 1$ coin or one 2$ coin


Sample Input 3: 
3

Sample Output 3: 
3

Explanation:
You can give three 1$ coin or one 1 $ coin one 2$ coin or three 1$ coin

No Comments

Sorry, the comment form is closed at this time.