<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>han_kan.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Mon, 26 Sep 2022 14:54:04 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>han_kan.log</title>
            <url>https://velog.velcdn.com/images/han_kan/profile/642c6974-b1d3-4517-addc-e7bf8b31484b/social_profile.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. han_kan.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/han_kan" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[220926 Today I Learned]]></title>
            <link>https://velog.io/@han_kan/220926-Today-I-Learned</link>
            <guid>https://velog.io/@han_kan/220926-Today-I-Learned</guid>
            <pubDate>Mon, 26 Sep 2022 14:54:04 GMT</pubDate>
            <description><![CDATA[<p>23일꺼 못썼다. 시간 지나니까 까먹네... 일단 시간없으니까 보류.</p>
<h1 id="상속">상속</h1>
<h3 id="📝-상속의-정의와-목적">📝 상속의 정의와 목적</h3>
<p>기존의 것(부모 class)를 재사용 + 자신의 것(자식 Class) 사용</p>
<p>→ 중복 코드를 줄일 수 있다. (필드, 메서드 재사용)</p>
<h3 id="📝-상속-간-클래스-호출">📝 상속 간 클래스 호출</h3>
<ul>
<li>상속 클래스(자식 Class) 생성자 호출 시 부모 클래스 생성자 호출</li>
</ul>
<p>예제코드</p>
<pre><code class="language-java">
class A {
    public A(){
        System.out.println(&quot;Class A의 생성자 호출&quot;);
    }
}

class B extends A {
    public B(){
        super();        //  넣지 않으면 컴파일러가 자동으로 생성
        System.out.println(&quot;Class B 의 super() 호출 (B의 부모생성자) 윗줄해서 함&quot;);

        System.out.println();
        System.out.println(&quot;Class B의 생성자 호출&quot;);
    }
}

class C extends B {
    public C(){
        System.out.println(&quot;Class C의 생성자 호출&quot;);
    }
}

public class Inheritance_1 {
    public static void main(String[] args) {
        System.out.println(&quot;C 생성자 호출&quot;);
        C c = new C();
        System.out.println();

        System.out.println(&quot;B 생성자 호출&quot;);
        B b = new B();
        System.out.println();
    }
}</code></pre>
<p><code>Class B</code> 는 <code>Class A</code> 를 상속받는 자식클래스이다.
<code>Class C</code> 는 <code>Class B</code> 를 상속받는 자식클래스이다.
<code>Class A</code> 는 부모클래스.</p>
<p>각 클래스의 생성자 호출에 주의하자
<code>Class C</code> 의 생성자를 호출하면 <code>Class B</code>의 생성자를 호출하고, <code>Class B</code>의 생성자는 <code>Class A</code>의 생성자를 호출한다. 
그러면 A -&gt; B -&gt; C  순서대로 생성자가 호출된다.</p>
<pre><code>C 생성자 호출
Class A의 생성자 호출
Class B 의 super() 호출 (B의 부모생성자) 윗줄해서 함

Class B의 생성자 호출
Class C의 생성자 호출

B 생성자 호출
Class A의 생성자 호출
Class B 의 super() 호출 (B의 부모생성자) 윗줄해서 함

Class B의 생성자 호출</code></pre><p>콘솔에는 이렇게 출력됨.</p>
<h3 id="super-사용"><code>super();</code> 사용</h3>
<p>자식 클래스의 default 생성자 안에는 <code>super();</code> 가 자동 생성된다.</p>
<ul>
<li>초기화라서 자식 클래스 default 생성자의 맨 위에서만 선언할 수 있다.</li>
<li>부모 클래스에 임의로 만들어진 생성자가 있으면 <code>super();</code> 안만들어짐.</li>
</ul>
<h3 id="supera-사용"><code>super.A;</code> 사용</h3>
<p>Method가 자신 클래스 내의 필드를 <code>this.a</code> 로 받는 것처럼, 부모 클래스의 필드를 <code>super.A</code> 이런 식으로 받는다.</p>
<br>

<h3 id="protected-상속에서-사용-해줄것">protected 상속에서 사용 해줄것</h3>
<p><br><br></p>
<h1 id="오버라이딩override">오버라이딩(Override)</h1>
<h3 id="📝-method-오버라이딩">📝 Method 오버라이딩</h3>
<ul>
<li>자식 클래스가 부모 클래스의 메서드를 자신의 쓰임새를 위해 재정의 하는 것.</li>
<li>부모 클래스의 <code>Method</code> 명, <code>Return Type</code> , <code>parameter</code> 가 같고 바디 안의 내용만 다르다.</li>
</ul>
<p>예제 코드</p>
<pre><code class="language-java">public class MethodOverriding_2 {
    public static void main(String[] args) {
        Manager obj1 = new Manager();
        System.out.println(&quot;관리자의 월급: &quot; + obj1.getSalary());

        Programmer obj2 = new Programmer();
        System.out.println(&quot;프로그래머의 월급: &quot; + obj2.getSalary());
    }
}

class Employee {
    int getSalary(){
        return 0;
    }
}

class Manager extends Employee {
    @Override
    int getSalary(){
        return 5000000;
    }
}

class Programmer extends Employee {
    @Override
    public int getSalary() {
        return 6000000;
    }
}</code></pre>
<p><code>Employee</code> 클래스를 상속받은 <code>Manager</code> 클래스, <code>Programmer</code> 클래스가 있다.</p>
<p><code>Manager</code> , <code>Programmer</code> 클래스 모두 <code>Employee</code> 에서 사용하는 <code>getSalary</code> Method 를 갖고 있다.</p>
<ul>
<li>이 때 <code>Manager</code> 클래스의 객체 변수로 <code>getSalary</code> 를 호출하면 <code>Manager</code> 클래스의 <code>getSalary</code> 가 호출되어 5000000이 리턴된다.</li>
<li>마찬가지로 <code>Programmer</code> 클래스의 객체변수도 <code>Programmer</code> 내의 <code>getSalary</code> 가 호출되어 6000000이 리턴된다.</li>
</ul>
<aside>
💡 Overriding 된 Method 호출 시 자식 클래스의 Method 가 호출된다.

</aside>

<h1 id="오버로딩">오버로딩</h1>
<h3 id="📝-오버로딩이란">📝 오버로딩이란?</h3>
<ul>
<li>같은 클래스 내에 있는 동일한 이름의 Method 를 사용하는 것.</li>
<li>같은 함수 이름으로 <code>parameter</code>의 개수나 타입을 달리 할 수 있다.</li>
<li><code>Return Type</code> , <code>parameter</code> 전부 동일하게는 만들 수 없다. (컴파일 에러)</li>
</ul>
<p>예제 코드</p>
<pre><code class="language-java">class Exployee {
    int getSalary(){
        return 0;
    }
    int getSalary(int x, int y) {
        return x * y;
    }
    int getSalary(String str) {
        return 0;
    }
}</code></pre>
<p>→ 위 코드처럼 <code>getSalary</code> Method 는 3가지 방식으로 오버로딩 되었다</p>
<aside>
💡 오버라이딩과 오버로딩의 차이를 확실히 알아야 한다.

</aside>

<ul>
<li>오버라이딩: 상속 내에서 이루어지는 Method 의 재정의</li>
<li>오버로딩: 같은 클래스 내에서 parameter 의 개수, 종류 / 리턴 타입 변화</li>
</ul>
<aside>
💡 같은 Method 이름으로 다양한 종류의 Parameter를 받을 수 있다.

</aside>

<p>→ (C 같은 경우 <code>getSalary</code> , <code>getSalary1</code> , <code>getSalary2</code> … 이렇게 함수 이름을 다르게 지정해야 한다.)</p>
<h1 id="다형성polymorphism">다형성(Polymorphism)</h1>
<p>이거 이해 잘안갔음.</p>
<ul>
<li><p>객체들의 타입이 다르면 똑같은 메세지가 전달되더라도 서로 다른 동작을 하는 것</p>
<p>  ⇒ 여러 형태를 가질 수 있는 것</p>
</li>
</ul>
<pre><code class="language-java">class Shape {

    public void draw() {
        System.out.println(&quot;도형을 그립니다.&quot;);
    }
}

class Rectangle extends Shape{
    @Override
    public void draw() {
        System.out.println(&quot;사각형을 그립니다.&quot;);
    }
}

Shape shape = new Rectangle();  &lt;&lt; upcasting</code></pre>
<ul>
<li>업캐스팅(upcasting) - 상형 형변환</li>
</ul>
<p>부모 클래스 변수로 자식 클래스 객체를 잠조할 수 있다. </p>
<p>⇒ 하위 객체를 상위 클래스형 변수에 대입</p>
<p>💫 위의 코드를 예시로 들어보면 부모 클래스 변수 Shape로 자식 클래스 객체인 Rectangle()을 참조했다.</p>
<aside>
💡 코드로 작성할 때 
부모 = 자식 형태로 형변환 없이 적는다 ⇒ (하위 객체를 상위 클래스형 변수에 대입)

</aside>

<p>```java
public class ShapeTest {</p>
<pre><code>public static void main(String[] args) {

    Rectangle rectangle = new Shape(); // 여기서 에러남.
    rectangle.draw();</code></pre><p>   }</p>
<p>}</p>
<p>🚨 반대 형태인 자식 = 부모 형태는 안 된다. </p>
<p>포함하는 데이터의 범위가 다르기 때문이다.</p>
<p>솔직히 귀찮아서 팀원분꺼 긁어왔다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[220922 Today I Learned]]></title>
            <link>https://velog.io/@han_kan/220922-Today-I-Learned</link>
            <guid>https://velog.io/@han_kan/220922-Today-I-Learned</guid>
            <pubDate>Thu, 22 Sep 2022 11:48:03 GMT</pubDate>
            <description><![CDATA[<h1 id="1-if--else-if-문">1. if / else if 문</h1>
<h1 id="2-switch-문">2. switch 문</h1>
<p><code>break</code> 가 없으면 조건 아래부터 전부 출력</p>
<p>예시</p>
<pre><code class="language-java">public static void main(String args[]){
    int n = 3;

    switch(n) {
    case 1:
        System.out.println(&quot;Simple Java&quot;);
    case 2:
        System.out.println(&quot;Funny Java&quot;);
    case 3:
        System.out.println(&quot;Fantastic Java&quot;);
    default:
        System.out.println(&quot;The best programming language&quot;);
    }

    System.out.println(&quot;Do you like Java?&quot;);
}</code></pre>
<p>위 코드 실행시 <code>break</code>가 없으므로 <code>case 3:</code>을 실행한 뒤 <code>default</code>도 실행한다.</p>
<pre><code>Fantastic Java
The best programming language
Do you like Java?</code></pre><p>위와 같은 결과가 나오게 된다.</p>
<pre><code class="language-java">case 1: case 2: case 3:
    System.out.println(&quot;This is possible&quot;);</code></pre>
<p>같은 결과를 출력하고 싶을 땐 <code>case</code>를 나열하고 실행문을 적을 수 있다.
<br>
<br></p>
<h3 id="참고-팁">참고 팁</h3>
<ul>
<li>되도록이면 <code>if</code>문 안에 <code>if</code>문을 넣지 말고 <code>else if</code>를 활용하도록 하자.</li>
<li>강사님 가위바위보 코드 이해할 것<pre><code class="language-java">import java.util.Scanner;
</code></pre>
</li>
</ul>
<p>public class 가위바위보게임 {</p>
<pre><code>public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.print(&quot;가위(0), 바위(1), 보(2): &quot;);
    int user = sc.nextInt();

    int computer = (int) (Math.random() * 3);

    if (user == computer)
        System.out.println(&quot;인간과 컴퓨터가 비겼음&quot;);
    else if (user == (computer + 1) % 3) // 0은 1한테 지고 1은 2한테, 2는 0한테 진다.
        System.out.println(&quot;인간: &quot; + user + &quot; 컴퓨터: &quot; + computer + &quot;   인간 승리&quot;);
    else
        System.out.println(&quot;인간: &quot; + user + &quot; 컴퓨터: &quot; + computer + &quot;   컴퓨터 승리&quot;);

}</code></pre><p>}</p>
<pre><code>
# 3. 클래스와 객체
객체지향 언어의 특징
* 캡슐화
* 상속
* 추상화
* 정보은닉 (public, private)

### 객체란?
클래스(`.class` 파일) &lt;-&gt; 객체(인스턴스)

### 클래스의 정의
* 클래스는 필드(속성)와 메소드(기능)로 구성
```java
class Circle {     //    클래스 정의

    int radius;    // 필드(변수)
    String color;

    double calcArea() {      // 메소드
        return 3.14 * radius * radius;
    }</code></pre><h3 id="객체의-생성">객체의 생성</h3>
<pre><code class="language-java">// main 함수 내부

    Circle obj; </code></pre>
<p> Data Type 이 <code>Circle</code> 인 참조변수 <code>obj</code> 선언 (<code>Circle</code>: 클래스, <code>obj</code>: 객체명)
<br></p>
<pre><code class="language-java">obj = new Circle();</code></pre>
<p><code>new</code> 를 사용해 메모리에 <code>Circle</code> 을 올림. <code>=</code> 으로 <code>obj</code> 에는 메모리에 올라간 <code>Circle</code> 의 주소 값이 들어감 </p>
<p><code>Circle();</code> 은 생성자</p>
<p>생성자는 나중에 더 배운다.
일단은 저건 기본생성자.</p>
<p><br><br>
<img src="https://velog.velcdn.com/images/han_kan/post/1e2439ad-6bb2-4705-902f-a86fb2b6e5d6/image.png" alt=""></p>
<p>위 그림과 같이 <code>obj</code> 가 메모리의 주소를 담고있고, 그 주소를 가리킨다.
<br><br></p>
<pre><code class="language-java">obj.radius = 100;
obj.color = &quot;blue&quot;;</code></pre>
<p>객체의 필드에 접근함
<br><br></p>
<pre><code class="language-java">double area = obj.calcArea();</code></pre>
<p>객체의 메서드에 접근함</p>
<p><img src="https://velog.velcdn.com/images/han_kan/post/ddf884f4-2922-4796-85e3-2e70c38a1b45/image.png" alt=""></p>
<p>객체의 필드와 메서드에 접근해 값을 넣었다.</p>
<p>저 값들이 1000번지 주소에 있는게 아니라 1000번지부터 4byte의 값에 저 값이 들어있는 주소가 들어있다.
<br></p>
<h3 id="string-도-객체이다">String 도 객체이다!</h3>
<pre><code class="language-java">String str1 = &quot;hi&quot;;</code></pre>
<p><code>str1</code>은 주소를 할당받고 그 주소에 가보면 메모리 영역에 <code>hi</code>가 들어있다.</p>
<br>
<aside>
💡 함수의 매개변수(parameter)란                                                                                               함수를 호출할 때 인수로 전달된 값을 함수 내부에서 사용할 수 있게 해주는 변수

</aside>

<aside>
💡 함수의 인수(argument)란                                                                                                       함수가 호출될 때 함수로 값을 전달해주는 변수

</aside>

<p><img src="https://velog.velcdn.com/images/han_kan/post/2dbf1749-b815-45d4-96c5-f77e234ace2d/image.png" alt=""></p>
<h1 id="0922-과제">0922 과제</h1>
<h3 id="1-수우미양가-프로그램">1. 수우미양가 프로그램</h3>
<pre><code class="language-java">import java.util.InputMismatchException;
import java.util.Scanner;

public class Homework {

    public static void main(String[] args) {
        Grade grade = new Grade();
        grade.run();
    }

}

class Grade {
    static Scanner sc = new Scanner(System.in);
    static int score;

    public static void run() {
        while (true) {
            try {
                System.out.print(&quot;성적을 입력하세요: &quot;);
                score = sc.nextInt();

                if (score &gt; 100) {
                    System.out.println(&quot;100 이하의 숫자를 입력하세요.&quot;);
                } else if (score &gt;= 90) {
                    System.out.println(&quot;등급: 수&quot;);
                    break;
                } else if (score &gt;= 80) {
                    System.out.println(&quot;등급: 우&quot;);
                    break;
                } else if (score &gt;= 70) {
                    System.out.println(&quot;등급: 미&quot;);
                    break;
                } else if (score &gt;= 60) {
                    System.out.println(&quot;등급: 양&quot;);
                    break;
                } else {
                    System.out.println(&quot;등급: 가&quot;);
                    break;
                }
            } catch (InputMismatchException err) {
                System.out.println(&quot;숫자를 입력하세요.&quot;);
                sc.next();
            }

        }
    }

}</code></pre>
<p><del><code>try catch</code>문에서 문자를 입력시 무한루프가 걸린다. 왜그럴까</del>
<code>sc.next();</code> 처리하면 된다.</p>
<br>

<h3 id="2-숫자게임-리팩토링">2. 숫자게임 리팩토링</h3>
<p>어제의 그 숫자게임. 객체를 사용해서 만들면 된다.</p>
<pre><code class="language-java">import java.util.InputMismatchException;
import java.util.Scanner;

public class GuessNumber {

    public static void main(String[] args) {
        Guess guess = new Guess();
        guess.Play();

    }

}

class Guess {
    int input;
    int count = 1;

    public void Play() {

        int Number = (int) (Math.random() * 100) + 1;
        Scanner sc = new Scanner(System.in);
        try {
            while (true) {
                if (count == 10) {
                    System.out.println(&quot;도전 횟수를 다 사용했어요.&quot;);
                    break;
                }
                System.out.print(&quot;정답을 추측하여 보시오: &quot;);
                input = sc.nextInt();
                if (input &gt; Number) {
                    System.out.println(&quot;HIGH  남은 도전횟수: &quot; + (10 - count));
                    count++;
                } else if (input &lt; Number) {
                    System.out.println(&quot;LOW  남은 도전횟수: &quot; + (10 - count));
                    count++;
                } else {
                    System.out.println(&quot;축하합니다. 시도횟수: &quot; + count);
                    break;
                }

            }
        } catch (InputMismatchException err) {
            System.out.println(&quot;숫자를 입력하세요.&quot;);
            sc.next();
        }

    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[220921 Today I Learned]]></title>
            <link>https://velog.io/@han_kan/220921-Today-I-Learned</link>
            <guid>https://velog.io/@han_kan/220921-Today-I-Learned</guid>
            <pubDate>Wed, 21 Sep 2022 13:08:42 GMT</pubDate>
            <description><![CDATA[<h1 id="1-형변환">1. 형변환</h1>
<p>피연산자의 자료형이 다르면 형변환이 일어남</p>
<ul>
<li>컴퓨터는 데이터 타입을 맞춰줘야 함</li>
<li>묵시적 형 변환(자동)</li>
<li>명시적 형 변환(강제)
: 조심해서 사용할 것</li>
</ul>
<h1 id="2-상수-final">2. 상수: final</h1>
<p>수정 불가한 값</p>
<ul>
<li>상수명은 전부 대문자로</li>
</ul>
<br>

<h3 id="-float는-지수-가수-형태로-표현되기-때문에-long보다-표현범위가-크다"><strong>* float는 지수, 가수 형태로 표현되기 때문에 long보다 표현범위가 크다.</strong></h3>
<h3 id="-사칙연산-시-리터럴은-기본으로-int-형이다"><strong>* 사칙연산 시 리터럴은 기본으로 int 형이다.</strong></h3>
<h1 id="3-연산자">3. 연산자</h1>
<h3 id="1-연산자의-결합-방향을-주의해야-한다">1. 연산자의 결합 방향을 주의해야 한다.</h3>
<p>연산자의 결합 방향이 ⬅오른쪽인지 ➡왼쪽인지 주의할 것!</p>
<h3 id="2-최우선-연산자-를-사용하자">2. 최우선 연산자 ()를 사용하자.</h3>
<pre><code class="language-java">if(a &gt; b || a + b * c &lt; c )
    System.out.println(&quot;영차&quot;);

if(a &gt; b || a + (b * c) &lt; c )
    System.out.println(&quot;영차&quot;);</code></pre>
<p>위 코드와 같은 경우 <code>a + b * c</code> 가 연산자 우선순위에 대해 가독성이 떨어질 수 있다.</p>
<p>최우선 연산자 ()를 사용해 연산 순위가 높은 부분이 어디인지 표시하자!</p>
<h3 id="3-연산에서-data-type이-다르다면-자동으로-casting-된다">3. 연산에서 Data Type이 다르다면 자동으로 Casting 된다.</h3>
<pre><code class="language-java">String str = &quot;JDK&quot; + 6.0;
// result: JDK6.0</code></pre>
<p><code>+</code> 연산에서 String과 double Type이 같이 들어왔다.</p>
<p>먼저 String Type <code>&quot;JDK&quot;</code> 가 나왔으므로 뒤의 double Type <code>6.0</code>은 String으로 Casting 된다.</p>
<pre><code class="language-java">String str2 = &quot;JDK&quot; + 3 + 3.0;
// result: JDK33.0</code></pre>
<p>앞의 <code>&quot;JDK&quot; + 3</code>  부분에서 <code>3</code> 이 String Type으로 Casting되고, 뒤의 <code>3.0</code> 도 String Type으로 캐스팅 된다.</p>
<pre><code class="language-java">String str3 = 3 + 3.0 + &quot;JDK&quot;;
// result: 6.0JDK</code></pre>
<p>앞의 <code>3 + 3.0</code> 은 int 와 double Type이다. 따라서 double Type으로 캐스팅 되고 <code>+</code> 연산이 진행된다.</p>
<p>뒤의 <code>+ &quot;JDK&quot;</code> 에서는 String Type과 double Type과의 연산이므로 앞의 <code>6.0</code> 이 String Type으로 Casting된다.</p>
<h3 id="4-전위연산--후위연산">4. 전위연산 / 후위연산</h3>
<pre><code class="language-java">int x = 1, y = 1;

int a = x++;
// result: 1

int b = ++y;
// result: 2</code></pre>
<p> <code>int a = x++;</code> 의 경우 x를 a에 먼저 집어넣고 그 다음 x증가시킨다.</p>
<p> <code>int b = ++y;</code> 의 경우 y+1 연산 후 b에 값을 집어넣는다.</p>
<h1 id="4-반복문">4. 반복문</h1>
<h3 id="for문">for문: <img src="https://velog.velcdn.com/images/han_kan/post/b01dd380-d035-497f-a989-1a0f51892551/image.png" alt=""></h3>
<p>위 사이클을 거친다</p>
<h3 id="-or-문이-and-보다-조건을-적게-보기-때문에-효율적">* OR 문이 AND 보다 조건을 적게 보기 때문에 효율적</h3>
<h1 id="5-배열">5. 배열</h1>
<pre><code class="language-java">int[] arr;    // 이 방법으로 표현하는 것이 더 좋다

int arr[];    // 얘보단 위 방법으로 표현할 것</code></pre>
<br>
<br>
# 오늘의 과제
<br>

<h3 id="1-별-탑쌓기">1. 별 탑쌓기</h3>
<pre><code class="language-java">import java.util.Scanner;

public class Loop {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.print(&quot;숫자를 입력하시오: &quot;);
        int input = sc.nextInt();
        System.out.println();


        for (int i = 1; i &lt;= input; i++) {
            for(int k = 0; k &lt; input-i; k++) {
                System.out.print(&quot; &quot;);
            }
            for (int j = 0; j &lt;  (i * 2) - 1; j++) {
                    System.out.print(&quot;*&quot;);
            }
            System.out.println();
        }

    }

}</code></pre>
<h3 id="2-숫자-추측-게임">2. 숫자 추측 게임</h3>
<pre><code class="language-java">import java.util.Scanner;

public class GuessNumber {

    public static void main(String[] args) {

        //    9/21 숫자맞추기 게임 과제
        int Number = (int)(Math.random() * 100) + 1;
        Scanner sc = new Scanner(System.in);
        int input = 0, count = 0;

        while(true) {
            System.out.print(&quot;정답을 추측하여 보시오: &quot;);
            input = sc.nextInt();
            if(input &gt; Number) {
                System.out.println(&quot;HIGH&quot;);
                count++;
            } else if(input &lt; Number) {
                System.out.println(&quot;LOW&quot;);
                count++;
            } else {
                count++;
                System.out.println(&quot;축하합니다. 시도횟수: &quot; + count);
                break;
            }

        }
    }

}</code></pre>
<p>결과는 잘 출력된다.</p>
]]></description>
        </item>
    </channel>
</rss>