From 72b05a56dde75317ffecab73a086fc870385fcf8 Mon Sep 17 00:00:00 2001 From: bit Date: Wed, 26 Dec 2018 17:58:48 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=ED=8C=A8?= =?UTF-8?q?=EC=93=B0=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .classpath | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.classpath b/.classpath index 51a8bba..cf9c6b5 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - - - - - - + + + + + + From 7c395dc7be1dc30745a3f5e907fbbc62e525fb33 Mon Sep 17 00:00:00 2001 From: bit Date: Wed, 26 Dec 2018 19:39:56 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/practice01/Prob1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/practice01/Prob1.java b/src/practice01/Prob1.java index c038781..eb03ee5 100644 --- a/src/practice01/Prob1.java +++ b/src/practice01/Prob1.java @@ -6,7 +6,7 @@ public class Prob1 { public static void main(String[] args) { Scanner scanner = new Scanner( System.in ); - + //? scanner.close(); } } From cd20da34e053d0ad0ef75c87ae9a61c112d68051 Mon Sep 17 00:00:00 2001 From: bit Date: Thu, 27 Dec 2018 16:22:57 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=97=B0=EC=8A=B5=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=92=80=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/practice01/Prob1.java | 11 ++++++++--- src/practice01/Prob2.java | 21 +++++++++++++++++++++ src/practice01/Prob3.java | 27 ++++++++++++++++++++++++++- src/practice01/Prob4.java | 7 +++++++ src/practice01/Prob5.java | 23 +++++++++++++++++++++++ 5 files changed, 85 insertions(+), 4 deletions(-) diff --git a/src/practice01/Prob1.java b/src/practice01/Prob1.java index eb03ee5..adda9c9 100644 --- a/src/practice01/Prob1.java +++ b/src/practice01/Prob1.java @@ -4,9 +4,14 @@ public class Prob1 { public static void main(String[] args) { - Scanner scanner = new Scanner( System.in ); - - //? + Scanner scanner = new Scanner(System.in); + System.out.print("수를 입력하세요 : "); + Scanner input_num = new Scanner(System.in); + int i = input_num.nextInt(); + if (i % 3 == 0) + System.out.println("3의 배수입니다."); + else + System.out.println("3의 배수가 아닙니다."); scanner.close(); } } diff --git a/src/practice01/Prob2.java b/src/practice01/Prob2.java index 32d40f0..821f97a 100644 --- a/src/practice01/Prob2.java +++ b/src/practice01/Prob2.java @@ -1,6 +1,27 @@ package practice01; +import java.util.Scanner; + public class Prob2 { public static void main(String[] args) { + System.out.print("숫자를 입력하시오 : "); + Scanner s = new Scanner(System.in); + int count = s.nextInt(); + int min_num = 1; + int max_num = 11; + while (true) { + if (count > 0) { + for (int i = min_num; i < max_num; i++) { + System.out.print(i); + } + } else { + break; + } + count--; + min_num++; + max_num++; + System.out.println(); + } } + } diff --git a/src/practice01/Prob3.java b/src/practice01/Prob3.java index 3b7ab3c..f9420b2 100644 --- a/src/practice01/Prob3.java +++ b/src/practice01/Prob3.java @@ -1,7 +1,32 @@ package practice01; +import java.util.Scanner; + public class Prob3 { - + public static void main(String[] args) { + + while (true) { + System.out.print("숫자를 입력하시오 : "); + Scanner s = new Scanner(System.in); + int input_num = s.nextInt(); + int sum = 0; + if (input_num % 2 == 0) { + for (int i = 1; i <= input_num; i++) { + if (i % 2 == 0) + sum += i; + + } + System.out.println(sum); + + } else { + for (int i = 1; i <= input_num; i++) { + if (i % 2 != 0) + sum += i; + } + System.out.println(sum); + } + System.out.println(); + } } } diff --git a/src/practice01/Prob4.java b/src/practice01/Prob4.java index 7d38c33..febfe8e 100644 --- a/src/practice01/Prob4.java +++ b/src/practice01/Prob4.java @@ -1,9 +1,16 @@ package practice01; +import java.util.Scanner; public class Prob4 { public static void main(String[] args) { + System.out.print("문자열을 입력하시오 : "); + Scanner s = new Scanner(System.in); + String input = s.nextLine(); + for(int i = 0; i 0) { + System.out.print(start + " "); + for (int i = 0; i < count; i++) { + System.out.print(clap); + } + System.out.println(); + } + + start++; + } } }