From 1444854aac0285b8b20f7a3195fd6372aa502016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sat, 11 Mar 2023 12:46:36 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=9E=85=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodingTest/src/Buja/test_1.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 0794aea..b88af1b 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -1,4 +1,4 @@ -package Buja; +package Buja; // syntax error public class test_1 { @@ -12,6 +12,19 @@ public class test_1 { //alt+방향키 : 코드 순서 바꾸기 public static void main(String[] args) { + class Solution { + public int solution(int n) { + int answer = 0; + for(int i=1; i<=n;i++) + { + if(n%i==0) + answer +=i; + } + return answer; + } + } + + } From 097d4e27e46fdc8e087a18f59681d3e4d8197ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sat, 11 Mar 2023 12:47:19 +0900 Subject: [PATCH 02/11] test --- CodingTest/src/Buja/test_1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index b88af1b..5fb0406 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -21,7 +21,7 @@ public int solution(int n) { answer +=i; } return answer; - } + } } From 71363409793c1d324afaaba7f8ce1211abe08802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sat, 11 Mar 2023 12:50:49 +0900 Subject: [PATCH 03/11] test 2 --- CodingTest/src/Buja/test_1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 5fb0406..68d7ec2 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -20,7 +20,7 @@ public int solution(int n) { if(n%i==0) answer +=i; } - return answer; + return answer; // test } } From 11b621c1ea60b1f6f244795f8dc188961cb4c553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sun, 12 Mar 2023 14:02:29 +0900 Subject: [PATCH 04/11] =?UTF-8?q?1~4=EB=B2=88=20=ED=92=80=EC=9D=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodingTest/src/Buja/test_1.java | 59 ++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 68d7ec2..50db932 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -11,6 +11,7 @@ public class test_1 { //ctrl+alt+방향키(위,아래) : 코드복사(커서위치줄의 코드를 밑이나 위에 복사) //alt+방향키 : 코드 순서 바꾸기 + /* 1. 정수 num이 짝수일 경우 "Even"을 반환하고 홀수인 경우 "Odd"를 반환하는 함수, solution을 완성해주세요. public static void main(String[] args) { class Solution { public int solution(int n) { @@ -23,10 +24,60 @@ public int solution(int n) { return answer; // test } } - - - - } + */ + + /* 2. 정수를 담고 있는 배열 arr의 평균값을 return하는 함수, solution을 완성해보세요. + * class Solution { + public double solution(int[] arr) { + double answer = 0; + + for(int i = 0; i0) + { + answer = answer + (n%10); + + n /= 10; + } + // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. + System.out.println("Hello Java"); + + return answer; + } } +*/ + + +} + + \ No newline at end of file From 1b8dfb033cceeb8f8a7d1fb79292440e2e984075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sun, 12 Mar 2023 14:24:55 +0900 Subject: [PATCH 05/11] =?UTF-8?q?5=EB=B2=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodingTest/src/Buja/test_1.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 50db932..0749f3c 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -75,6 +75,20 @@ public int solution(int n) { return answer; } } + +/* 5. 함수 solution은 정수 x와 자연수 n을 입력 받아, x부터 시작해 x씩 증가하는 숫자를 n개 지니는 리스트를 리턴해야 합니다. */ + * class Solution { + public long[] solution(int x, int n) { + long[] answer = new long[n]; + + for(int i =0; i Date: Sun, 12 Mar 2023 15:23:46 +0900 Subject: [PATCH 06/11] =?UTF-8?q?7=EB=B2=88=20=ED=92=80=EC=9D=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodingTest/src/Buja/test_1.java | 34 ++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 0749f3c..79ddcd8 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -76,7 +76,7 @@ public int solution(int n) { } } -/* 5. 함수 solution은 정수 x와 자연수 n을 입력 받아, x부터 시작해 x씩 증가하는 숫자를 n개 지니는 리스트를 리턴해야 합니다. */ +/* 5. 함수 solution은 정수 x와 자연수 n을 입력 받아, x부터 시작해 x씩 증가하는 숫자를 n개 지니는 리스트를 리턴해야 합니다. * class Solution { public long[] solution(int x, int n) { long[] answer = new long[n]; @@ -89,9 +89,41 @@ public long[] solution(int x, int n) { } } */ +/* +6. 자연수 뒤집어 배열로 만들기 */ + /* 7. 문자열 내 p와 y의 개수 +class Solution { + boolean solution(String s) { + boolean answer = true; + int p =0; + int y= 0; + for(int i =0;i Date: Mon, 13 Mar 2023 21:21:11 +0900 Subject: [PATCH 07/11] =?UTF-8?q?8=EB=B2=88=20=EC=A0=95=EC=88=98=20?= =?UTF-8?q?=EC=A0=9C=EA=B3=B1=EA=B7=BC=20=ED=8C=90=EB=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodingTest/src/Buja/test_1.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 79ddcd8..fb67980 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -124,6 +124,23 @@ else if(((s.charAt(i)) == 'y')|| ((s.charAt(i)) == 'Y')) return answer; } } + +/* 8. 정수 제곱근 판별 + * class Solution { + public long solution(long n) { + + for(long i=0;i<500000000;i++) + { + if((i*i)==n) + { + return ((i+1)*(i+1)); + } + } + return -1; + } +} +*/ + */ } \ No newline at end of file From b9d6a22c771d5d8726cc94698ea72ac35f334601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Fri, 17 Mar 2023 23:36:28 +0900 Subject: [PATCH 08/11] =?UTF-8?q?9=EB=B2=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CodingTest/src/Buja/test_1.java | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index fb67980..215f020 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -1,7 +1,5 @@ package Buja; // syntax error - public class test_1 { - /*인코딩 (한글,영문,한자,일본어 -> 기계어)방식 (한글. UTF-8, EUC-KR) EUC-KR(완성형,박)에서 UTF-8(조합형,ㅂ+ㅏ+ㄱ)로 넘어갈때 코딩이 깨질수도 있음. 미리바꿔야함. window - preference - workspace - utf8 @@ -58,7 +56,6 @@ public int solution(int n) { /*4. 자연수 N이 주어지면, N의 각 자릿수의 합을 구해서 return 하는 solution 함수를 만들어 주세요. import java.util.*; - public class Solution { public int solution(int n) { int answer = 0; @@ -71,11 +68,9 @@ public int solution(int n) { } // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. System.out.println("Hello Java"); - return answer; } } - /* 5. 함수 solution은 정수 x와 자연수 n을 입력 받아, x부터 시작해 x씩 증가하는 숫자를 n개 지니는 리스트를 리턴해야 합니다. * class Solution { public long[] solution(int x, int n) { @@ -98,7 +93,6 @@ boolean solution(String s) { boolean answer = true; int p =0; int y= 0; - for(int i =0;i Date: Sun, 19 Mar 2023 16:08:00 +0900 Subject: [PATCH 09/11] ff --- CodingTest/src/Buja/test_1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index 215f020..f2e47f6 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -143,7 +143,7 @@ public int solution(int n) { break; } } - return answer; + return answer; } } */ From ec512c35ceac4052c824a37add2cabbbf186a85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sun, 19 Mar 2023 16:10:03 +0900 Subject: [PATCH 10/11] test --- CodingTest/src/Buja/test_1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodingTest/src/Buja/test_1.java b/CodingTest/src/Buja/test_1.java index f2e47f6..41f452d 100644 --- a/CodingTest/src/Buja/test_1.java +++ b/CodingTest/src/Buja/test_1.java @@ -107,7 +107,7 @@ else if(((s.charAt(i)) == 'y')|| ((s.charAt(i)) == 'Y')) } if(p==y) - { + { answer = true; } else From 96ee14b3274a320af0af2e806d6b33b173246c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=84=EC=84=9D?= <최현석@DESKTOP-MQKO3ME> Date: Sun, 19 Mar 2023 16:14:32 +0900 Subject: [PATCH 11/11] test --- .project | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .project diff --git a/.project b/.project new file mode 100644 index 0000000..639e0a2 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + GiraffaCodingTest + + + + + + + +