백준 00147 동전 0 - java


백준 00147 동전 0 - java

import java.util.*; public class Main { public static void main (String args[]) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); String[] input = line.split(" "); int coinTypes = Integer.parseInt(input[0]); int totalPrice = Integer.parseInt(input[1]); ArrayList<Integer> coinType = new ArrayList<>(); for (int i = 0 ; i < coinTypes ; i++) { String coin = sc.nextLine(); coinType.add(Integer.parseInt(coin)); } int count = 0; for (int i = coinTypes-1 ; i >= 0 ; i--) { if (totalPric...



원문링크 : 백준 00147 동전 0 - java