2019-04-28

package text;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class text {
    public static void main(String []asgv) {
        Scanner scan = new Scanner(System.in);
        int price = scan.nextInt();
        int money = scan.nextInt();
        int left = money - price;
        if(left < 0 )
            System.out.println("Not enough money");
        else if(left == 0)
            System.out.println("No charge!");
        else
            judge(left);
        
        
    }
     
    public static void judge(int left) {
        //if(left < 0)
            //
        //return false;
        
        Map map = new HashMap();
        int t[] = new int[4];
        t[0] = 50;
        t[1] = 10;
        t[2] = 5;
        t[3] = 1;
        for(int i=0; i= t[i]){
                map.put(t[i], left / t[i]);
                left %= t[i];
            }else{
                map.put(t[i], 0);
            }
        }
        for(int i=0; i

你可能感兴趣的:(2019-04-28)