Coin Changes
Description
Discuss (1 comment)
Given an infinite number of quarters (25 cents), dimes (10 cents), nickels (5 cents) and pennies (1 cent), write code to calculate the number of ways of representing n cents.
E.g. Given 7 cents, there are two ways, 1 nickels + 2 pennies or 7 pennies.
E.g. Given 7 cents, there are two ways, 1 nickels + 2 pennies or 7 pennies.
Input Specifications
Your program must take a single command line argument; the name of a file. It must then open the file and read out the input data. Each line will contain an integer number e.g.10 25 100
Output Specifications
Your output must consist of exactly same number of lines as input with the expected results to the standard output. Using the above example, the output should be:4 13 242
© CoderCharts - All Rights Reserved
| Type | Puzzle | Pass | 113 | Fail | 180 | ||
| Scoring | Language | Level | Novice | Points | 400 | ||
| Tags | bits, math | ||||||
Unit Tests
| Name | CPU Unit | Memory Unit |
|---|---|---|
test1 |
Confirm that you want to switch languages
Your current edits will be lost.
Confirm that you wish to load a previous submission
Your current edits will be lost.