From 4d15b5e1e1d82df4eddee38f2289e08223111fa3 Mon Sep 17 00:00:00 2001 From: zinzo Date: Sun, 24 Aug 2025 21:53:44 +0900 Subject: [PATCH] =?UTF-8?q?9=EC=A3=BC=EC=B0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit c9d611478efd09d452f803538d7c28f6eb02748d) --- .../9\354\243\274\354\260\250/Problem5585" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "zinzoddari/9\354\243\274\354\260\250/Problem5585" diff --git "a/zinzoddari/9\354\243\274\354\260\250/Problem5585" "b/zinzoddari/9\354\243\274\354\260\250/Problem5585" new file mode 100644 index 0000000..f726a87 --- /dev/null +++ "b/zinzoddari/9\354\243\274\354\260\250/Problem5585" @@ -0,0 +1,24 @@ +```java +import java.io.BufferedReader; +import java.io.InputStreamReader; + +public class Main { + private static final int[] COINS = {500, 100, 50, 10, 5, 1}; + + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + final int price = Integer.parseInt(br.readLine().trim()); + + int change = 1000 - price; + + int count = 0; + for (int it : COINS) { + count += change / it; + change %= it; + } + + System.out.println(count); + } +} +``` \ No newline at end of file