Study 잔돈 계산하기 bslime 2008. 5. 31. 01:00 import java.io.*; class MoneyTest { public static void main (String args[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int a,b,c,d,e,f; System.out.println("액수를 입력하세요"); String mon = in.readLine(); int moni = Integer.parseInt(mon); a = moni/10000; moni = moni - (a * 10000); b = moni/1000; moni = moni - (b * 1000); c = moni/500; moni = moni - (c * 500); d = moni/100; moni = moni - (d * 100); e = moni/10; moni = moni - (e * 10); f = moni/1; System.out.println("일만원권 : " + a + "장"); System.out.println("천원권 : " + b + "장"); System.out.println("오백원주화 : " + c + "개"); System.out.println("백원주화 : " + d + "개"); System.out.println("십원주화 : " + e + "개"); System.out.println("일원주화 : " + f + "개"); } }