From a23af5692d6f5c18d9c2e167aa6b00eb09f21284 Mon Sep 17 00:00:00 2001 From: "Janghun Lee(James)" <72970232+jangh-lee@users.noreply.github.com> Date: Thu, 16 Feb 2023 20:18:04 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Create=20003-=EC=9E=90=EB=A6=BF=EC=88=98=20?= =?UTF-8?q?=EB=8D=94=ED=95=98=EA=B8=B0.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\230 \353\215\224\355\225\230\352\270\260.java" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "003-\354\236\220\353\246\277\354\210\230 \353\215\224\355\225\230\352\270\260.java" diff --git "a/003-\354\236\220\353\246\277\354\210\230 \353\215\224\355\225\230\352\270\260.java" "b/003-\354\236\220\353\246\277\354\210\230 \353\215\224\355\225\230\352\270\260.java" new file mode 100644 index 0000000..4f96cb5 --- /dev/null +++ "b/003-\354\236\220\353\246\277\354\210\230 \353\215\224\355\225\230\352\270\260.java" @@ -0,0 +1,14 @@ +import java.util.*; + +public class Solution { + public int solution(int n) { + int answer = 0; + + String s = Integer.toString(n); + + for(int i=0; i < s.length(); i++){ + answer += Integer.parseInt(s.substring(i, i+1)); + } + return answer; + } +} From f29f55ea68e4ccb9063256fa4efc74b385b30485 Mon Sep 17 00:00:00 2001 From: "Janghun Lee(James)" <72970232+jangh-lee@users.noreply.github.com> Date: Thu, 16 Feb 2023 20:18:34 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Create=20002-=EC=A7=9D=EC=88=98=EC=99=80?= =?UTF-8?q?=ED=99=80=EC=88=98.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\210\230\354\231\200\355\231\200\354\210\230.java" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "002-\354\247\235\354\210\230\354\231\200\355\231\200\354\210\230.java" diff --git "a/002-\354\247\235\354\210\230\354\231\200\355\231\200\354\210\230.java" "b/002-\354\247\235\354\210\230\354\231\200\355\231\200\354\210\230.java" new file mode 100644 index 0000000..2c2f22f --- /dev/null +++ "b/002-\354\247\235\354\210\230\354\231\200\355\231\200\354\210\230.java" @@ -0,0 +1,10 @@ +class Solution { + public String solution(int num) { + + if (num % 2 == 0) { + return ("Even"); + } else { + return("Odd"); + } + } +} From ec5881313fe897e6f2c40b85ed984e6e7f06e2cb Mon Sep 17 00:00:00 2001 From: "Janghun Lee(James)" <72970232+jangh-lee@users.noreply.github.com> Date: Thu, 16 Feb 2023 20:22:31 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Create=20001-=ED=8F=89=EA=B7=A0=20=EA=B5=AC?= =?UTF-8?q?=ED=95=98=EA=B8=B0.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\267\240 \352\265\254\355\225\230\352\270\260.java" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "001-\355\217\211\352\267\240 \352\265\254\355\225\230\352\270\260.java" diff --git "a/001-\355\217\211\352\267\240 \352\265\254\355\225\230\352\270\260.java" "b/001-\355\217\211\352\267\240 \352\265\254\355\225\230\352\270\260.java" new file mode 100644 index 0000000..fe3f641 --- /dev/null +++ "b/001-\355\217\211\352\267\240 \352\265\254\355\225\230\352\270\260.java" @@ -0,0 +1,10 @@ +double solution(int arr[], size_t arr_len) { + int sum = 0; + for (int i = 0; i < arr_len; i++) { + sum += arr[i]; + } + + double answer = (double) sum / arr_len; + + return answer; + }