From 848903bd06e53b0034841b998d03ad25fe68e656 Mon Sep 17 00:00:00 2001 From: waterSpray Date: Fri, 3 Jul 2020 21:08:59 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Solution.java" | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git "a/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" "b/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" index 0411734..06c9a0c 100644 --- "a/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" +++ "b/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" @@ -5,9 +5,7 @@ class Solution { public boolean solution(int x) { - return false; + System.out.println("헬로 월드!"); + return true; } - -} - - \ No newline at end of file +} \ No newline at end of file From da6809018f6fa5ad0af612464bc4477095770034 Mon Sep 17 00:00:00 2001 From: waterSpray Date: Fri, 3 Jul 2020 21:11:52 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=B0=94=EA=BF=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Solution.java" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" "b/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" index 06c9a0c..99b0a08 100644 --- "a/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" +++ "b/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" @@ -5,7 +5,7 @@ class Solution { public boolean solution(int x) { - System.out.println("헬로 월드!"); + System.out.println("hello world!"); return true; } } \ No newline at end of file From 3356c7e3563689de1b83ae03b1424de9eca3420c Mon Sep 17 00:00:00 2001 From: waterSpray Date: Mon, 6 Jul 2020 00:20:22 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=ED=95=98=EC=83=A4=EB=93=9C=20=EC=88=98=20?= =?UTF-8?q?=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Solution.java" | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git "a/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" "b/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" index 99b0a08..d618db0 100644 --- "a/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" +++ "b/week1/1. \355\225\230\354\203\244\353\223\234 \354\210\230/Solution.java" @@ -5,7 +5,22 @@ class Solution { public boolean solution(int x) { - System.out.println("hello world!"); - return true; + + int sum = sumOfDigit(x); + + return x % sum == 0; + } + + private int sumOfDigit(int x) { + + int sum = 0; + + while (x > 0) { + sum += x % 10; + x /= 10; + } + + return sum; } + } \ No newline at end of file