/*
 * Program to find the minimum number of coins equal to an amount,
 * given the following denominations: 1c, 5c, 10c, 20c, 50c, $1.
 * Note that there is no selection and repetition statements here
 * as these are not covered yet.
 * File: Ch3CoinChange.java
 * Aaron Tan
 */

import java.util.*;

class Ch3CoinChange {

   public static void main(String[] args) {
      
      Scanner scanner = new Scanner(System.in);

      System.out.print("Enter amount in cents: ");
      int amt = scanner.nextInt();

      int coins = 0;  // initialising answer to 0

      coins += amt / 100;
      amt %= 100;

      coins += amt / 50;
      amt %= 50;

      coins += amt / 20;
      amt %= 20;

      coins += amt / 10;
      amt %= 10;

      coins += amt / 5;
      amt %= 5;

      coins += amt;

      System.out.println("Number of coins = " + coins);
   }
}


