<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>ho_vi.log</title>
        <link>https://velog.io/</link>
        <description>풀스택 예비 개발자</description>
        <lastBuildDate>Thu, 08 Jun 2023 01:33:21 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>ho_vi.log</title>
            <url>https://velog.velcdn.com/images/ho_vi/profile/c06fa477-465f-4a41-b9dc-7ef1f48e85fc/image.jpg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. ho_vi.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/ho_vi" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[ORM과 JPM]]></title>
            <link>https://velog.io/@ho_vi/ORM%EA%B3%BC-JPM</link>
            <guid>https://velog.io/@ho_vi/ORM%EA%B3%BC-JPM</guid>
            <pubDate>Thu, 08 Jun 2023 01:33:21 GMT</pubDate>
            <description><![CDATA[<p>orm 사용하는 이유
db에 종속성이 약하다.
db문법을 몰라도 사용이 가능함
db(sql)를 몰라도됨
데이터베이스가 어떤게 와도 상관없음</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[팰린드롬인지 확인하기]]></title>
            <link>https://velog.io/@ho_vi/%ED%8C%B0%EB%A6%B0%EB%93%9C%EB%A1%AC%EC%9D%B8%EC%A7%80-%ED%99%95%EC%9D%B8%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@ho_vi/%ED%8C%B0%EB%A6%B0%EB%93%9C%EB%A1%AC%EC%9D%B8%EC%A7%80-%ED%99%95%EC%9D%B8%ED%95%98%EA%B8%B0</guid>
            <pubDate>Tue, 30 May 2023 14:12:19 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>29507</td>
<td>19186</td>
<td>16521</td>
<td>66.240%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>알파벳 소문자로만 이루어진 단어가 주어진다. 이때, 이 단어가 팰린드롬인지 아닌지 확인하는 프로그램을 작성하시오.</p>
<p>팰린드롬이란 앞으로 읽을 때와 거꾸로 읽을 때 똑같은 단어를 말한다.</p>
<p>level, noon은 팰린드롬이고, baekjoon, online, judge는 팰린드롬이 아니다.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 단어가 주어진다. 단어의 길이는 1보다 크거나 같고, 100보다 작거나 같으며, 알파벳 소문자로만 이루어져 있다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 팰린드롬이면 1, 아니면 0을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>level
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>1
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>baekjoon
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>0</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-sql">import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int a = 0;
        for (int i = 0; i &lt; s.length(); i++) {
            if (s.charAt(i)!=s.charAt(s.length()-(i+1))){
                a = 0;
                break;
            }
            else a=1;
        }
        System.out.println(a);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[바구니 순서 바꾸기(미완)]]></title>
            <link>https://velog.io/@ho_vi/%EB%B0%94%EA%B5%AC%EB%8B%88-%EC%88%9C%EC%84%9C-%EB%B0%94%EA%BE%B8%EA%B8%B0%EB%AF%B8%EC%99%84</link>
            <guid>https://velog.io/@ho_vi/%EB%B0%94%EA%B5%AC%EB%8B%88-%EC%88%9C%EC%84%9C-%EB%B0%94%EA%BE%B8%EA%B8%B0%EB%AF%B8%EC%99%84</guid>
            <pubDate>Tue, 30 May 2023 14:11:57 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>6776</td>
<td>4307</td>
<td>3889</td>
<td>66.230%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>도현이는 바구니를 총 N개 가지고 있고, 각각의 바구니에는 1번부터 N번까지 번호가 순서대로 적혀져 있다. 바구니는 일렬로 놓여져 있고, 가장 왼쪽 바구니를 1번째 바구니, 그 다음 바구니를 2번째 바구니, ..., 가장 오른쪽 바구니를 N번째 바구니라고 부른다.</p>
<p>도현이는 앞으로 M번 바구니의 순서를 회전시키려고 만들려고 한다. 도현이는 바구니의 순서를 회전시킬 때, 순서를 회전시킬 범위를 정하고, 그 범위 안에서 기준이 될 바구니를 선택한다. 도현이가 선택한 바구니의 범위가 begin, end이고, 기준이 되는 바구니를 mid라고 했을 때, begin, begin+1, ..., mid-1, mid, mid+1, ..., end-1, end 순서로 되어있는 바구니의 순서를 mid, mid+1, ..., end-1, end, begin, begin+1, ..., mid-1로 바꾸게 된다.</p>
<p>바구니의 순서를 어떻게 회전시킬지 주어졌을 때, M번 바구니의 순서를 회전시킨 다음, 바구니에 적혀있는 번호를 가장 왼쪽 바구니부터 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 N (1 ≤ N ≤ 100)과 M (1 ≤ M ≤ 100)이 주어진다.</p>
<p>둘째 줄부터 M개의 줄에는 바구니의 순서를 바꾸는 만드는 방법이 주어진다. 방법은 i, j, k로 나타내고, 왼쪽으로부터 i번째 바구니부터 j번째 바구니의 순서를 회전시키는데, 그 때 기준 바구니는 k번째 바구니라는 뜻이다. (1 ≤ i ≤ k ≤ j ≤ N)</p>
<p>도현이는 입력으로 주어진 순서대로 바구니의 순서를 회전시킨다.</p>
<h2 id="출력">출력</h2>
<p>모든 순서를 회전시킨 다음에, 가장 왼쪽에 있는 바구니부터 바구니에 적혀있는 순서를 공백으로 구분해 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>10 5
1 6 4
3 9 8
2 10 5
1 3 3
2 6 2
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>1 4 6 2 3 7 10 5 8 9</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[별 찍기 - 7]]></title>
            <link>https://velog.io/@ho_vi/%EB%B3%84-%EC%B0%8D%EA%B8%B0-7</link>
            <guid>https://velog.io/@ho_vi/%EB%B3%84-%EC%B0%8D%EA%B8%B0-7</guid>
            <pubDate>Tue, 30 May 2023 14:10:57 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>39591</td>
<td>26325</td>
<td>23659</td>
<td>67.705%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>예제를 보고 규칙을 유추한 뒤에 별을 찍어 보세요.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 N(1 ≤ N ≤ 100)이 주어진다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄부터 2×N-1번째 줄까지 차례대로 별을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>5
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i &lt;= n; i++) {
            for (int j = 1; j &lt;= n-i; j++) {
                sb.append(&quot; &quot;);
            }
            for (int j = 1; j &lt;= 2*i-1; j++) {
                sb.append(&quot;*&quot;);
            }
            sb.append(&quot;\n&quot;);
        }
        for (int i = n-1; i &gt;= 1; i--) {
            for (int j = 1; j &lt;= n-i; j++) {
                sb.append(&quot; &quot;);
            }
            for (int j = 1; j &lt;= 2*i-1; j++) {
                sb.append(&quot;*&quot;);
            }
            sb.append(&quot;\n&quot;);
        }
        System.out.print(sb);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[평균은 넘겠지]]></title>
            <link>https://velog.io/@ho_vi/%ED%8F%89%EA%B7%A0%EC%9D%80-%EB%84%98%EA%B2%A0%EC%A7%80</link>
            <guid>https://velog.io/@ho_vi/%ED%8F%89%EA%B7%A0%EC%9D%80-%EB%84%98%EA%B2%A0%EC%A7%80</guid>
            <pubDate>Tue, 30 May 2023 14:10:29 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>256734</td>
<td>92497</td>
<td>75966</td>
<td>35.811%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>대학생 새내기들의 90%는 자신이 반에서 평균은 넘는다고 생각한다. 당신은 그들에게 슬픈 진실을 알려줘야 한다.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에는 테스트 케이스의 개수 C가 주어진다.</p>
<p>둘째 줄부터 각 테스트 케이스마다 학생의 수 N(1 ≤ N ≤ 1000, N은 정수)이 첫 수로 주어지고, 이어서 N명의 점수가 주어진다. 점수는 0보다 크거나 같고, 100보다 작거나 같은 정수이다.</p>
<h2 id="출력">출력</h2>
<p>각 케이스마다 한 줄씩 평균을 넘는 학생들의 비율을 반올림하여 소수점 셋째 자리까지 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>5
5 50 50 70 80 100
7 100 95 90 80 70 60 50
3 70 90 80
3 70 90 81
9 100 99 98 97 96 95 94 93 91
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>40.000%
57.143%
33.333%
66.667%
55.556%</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = Integer.parseInt(br.readLine());
        StringTokenizer st;

        for(int i=0;i&lt;n;i++) {
            st = new StringTokenizer(br.readLine());
            int num = Integer.parseInt(st.nextToken());
            int sum = 0;
            ArrayList&lt;Integer&gt; arr = new ArrayList&lt;&gt;();

            while(st.hasMoreTokens()) {
                arr.add(Integer.parseInt(st.nextToken()));
                sum += arr.get(arr.size()-1);
            }

            float avg = (float)sum/(float)num;
            int cnt = 0;

            for(int s : arr) {
                if(s&gt;avg) cnt++;
            }

            bw.write(String.format(&quot;%.3f&quot;,(float)cnt/num*100)+&quot;%&quot;);
            bw.newLine();
        }
        br.close();
        bw.close();
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[킹, 퀸, 룩, 비숍, 나이트, 폰]]></title>
            <link>https://velog.io/@ho_vi/%ED%82%B9-%ED%80%B8-%EB%A3%A9-%EB%B9%84%EC%88%8D-%EB%82%98%EC%9D%B4%ED%8A%B8-%ED%8F%B0</link>
            <guid>https://velog.io/@ho_vi/%ED%82%B9-%ED%80%B8-%EB%A3%A9-%EB%B9%84%EC%88%8D-%EB%82%98%EC%9D%B4%ED%8A%B8-%ED%8F%B0</guid>
            <pubDate>Tue, 30 May 2023 14:10:00 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>83693</td>
<td>45226</td>
<td>40053</td>
<td>55.176%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>동혁이는 오래된 창고를 뒤지다가 낡은 체스판과 피스를 발견했다.</p>
<p>체스판의 먼지를 털어내고 걸레로 닦으니 그럭저럭 쓸만한 체스판이 되었다. 하지만, 검정색 피스는 모두 있었으나, 흰색 피스는 개수가 올바르지 않았다.</p>
<p>체스는 총 16개의 피스를 사용하며, 킹 1개, 퀸 1개, 룩 2개, 비숍 2개, 나이트 2개, 폰 8개로 구성되어 있다.</p>
<p>동혁이가 발견한 흰색 피스의 개수가 주어졌을 때, 몇 개를 더하거나 빼야 올바른 세트가 되는지 구하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 동혁이가 찾은 흰색 킹, 퀸, 룩, 비숍, 나이트, 폰의 개수가 주어진다. 이 값은 0보다 크거나 같고 10보다 작거나 같은 정수이다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 입력에서 주어진 순서대로 몇 개의 피스를 더하거나 빼야 되는지를 출력한다. 만약 수가 양수라면 동혁이는 그 개수 만큼 피스를 더해야 하는 것이고, 음수라면 제거해야 하는 것이다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>0 1 2 2 2 7
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>1 0 0 0 0 1
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>2 1 2 1 2 1
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>-1 0 0 1 0 7</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int king= 1;
        int queen = 1;
        int rook = 2;
        int bishop = 2;
        int knight = 2;
        int pawn = 8;

        king = king-sc.nextInt();
        queen = queen-sc.nextInt();
        rook = rook-sc.nextInt();
        bishop = bishop-sc.nextInt();
        knight = knight-sc.nextInt();
        pawn = pawn-sc.nextInt();

        System.out.print(king+&quot; &quot;);
        System.out.print(queen+&quot; &quot;);
        System.out.print(rook+&quot; &quot;);
        System.out.print(bishop+&quot; &quot;);
        System.out.print(knight+&quot; &quot;);
        System.out.print(pawn);

    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[새싹]]></title>
            <link>https://velog.io/@ho_vi/%EC%83%88%EC%8B%B9</link>
            <guid>https://velog.io/@ho_vi/%EC%83%88%EC%8B%B9</guid>
            <pubDate>Tue, 30 May 2023 14:09:33 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>1024 MB</td>
<td>81575</td>
<td>41060</td>
<td>38089</td>
<td>51.721%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>아래 예제와 같이 새싹을 출력하시오.</p>
<h2 id="입력">입력</h2>
<p>입력은 없다.</p>
<h2 id="출력">출력</h2>
<p>새싹을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code></code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>         ,r&#39;&quot;7
r`-_   ,&#39;  ,/
 \. &quot;. L_r&#39;
   `~\/
      |
      |</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">public class Main {
    public static void main(String[] args) {
        System.out.println(&quot;         ,r&#39;\&quot;7&quot;);
        System.out.println(&quot;r`-_   ,&#39;  ,/&quot;);
        System.out.println(&quot; \\. \&quot;. L_r&#39;&quot;);
        System.out.println(&quot;   `~\\/&quot;);
        System.out.println(&quot;      |&quot;);
        System.out.println(&quot;      |&quot;);

    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[그대로 출력하기]]></title>
            <link>https://velog.io/@ho_vi/%EA%B7%B8%EB%8C%80%EB%A1%9C-%EC%B6%9C%EB%A0%A5%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@ho_vi/%EA%B7%B8%EB%8C%80%EB%A1%9C-%EC%B6%9C%EB%A0%A5%ED%95%98%EA%B8%B0</guid>
            <pubDate>Tue, 30 May 2023 14:09:04 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>181677</td>
<td>49817</td>
<td>40381</td>
<td>30.201%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>입력 받은 대로 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>입력이 주어진다. 입력은 최대 100줄로 이루어져 있고, 알파벳 소문자, 대문자, 공백, 숫자로만 이루어져 있다. 각 줄은 100글자를 넘지 않으며, 빈 줄은 주어지지 않는다. 또, 각 줄은 공백으로 시작하지 않고, 공백으로 끝나지 않는다.</p>
<h2 id="출력">출력</h2>
<p>입력받은 그대로 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>Hello
Baekjoon
Online Judge
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>Hello
Baekjoon
Online Judge</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()) {
            System.out.println(in.nextLine());
        }

    }
}</code></pre>
<p>hasNext를 통해 값이 없을 때 까지 출력</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[다이얼]]></title>
            <link>https://velog.io/@ho_vi/%EB%8B%A4%EC%9D%B4%EC%96%BC</link>
            <guid>https://velog.io/@ho_vi/%EB%8B%A4%EC%9D%B4%EC%96%BC</guid>
            <pubDate>Tue, 30 May 2023 14:08:43 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>102526</td>
<td>60092</td>
<td>52427</td>
<td>58.491%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>상근이의 할머니는 아래 그림과 같이 오래된 다이얼 전화기를 사용한다.</p>
<p><img src="https://upload.acmicpc.net/9c88dd24-3a4c-4a09-bc50-e6496958214d/-/preview/" alt="!"></p>
<p>전화를 걸고 싶은 번호가 있다면, 숫자를 하나를 누른 다음에 금속 핀이 있는 곳 까지 시계방향으로 돌려야 한다. 숫자를 하나 누르면 다이얼이 처음 위치로 돌아가고, 다음 숫자를 누르려면 다이얼을 처음 위치에서 다시 돌려야 한다.</p>
<p>숫자 1을 걸려면 총 2초가 필요하다. 1보다 큰 수를 거는데 걸리는 시간은 이보다 더 걸리며, 한 칸 옆에 있는 숫자를 걸기 위해선 1초씩 더 걸린다.</p>
<p>상근이의 할머니는 전화 번호를 각 숫자에 해당하는 문자로 외운다. 즉, 어떤 단어를 걸 때, 각 알파벳에 해당하는 숫자를 걸면 된다. 예를 들어, UNUCIC는 868242와 같다.</p>
<p>할머니가 외운 단어가 주어졌을 때, 이 전화를 걸기 위해서 필요한 최소 시간을 구하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 알파벳 대문자로 이루어진 단어가 주어진다. 단어의 길이는 2보다 크거나 같고, 15보다 작거나 같다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 다이얼을 걸기 위해서 필요한 최소 시간을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>WA
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>13
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>UNUCIC
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>36</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int n = 0;
        for (int i = 0; i &lt; s.length(); i++) {
            if (s.charAt(i)&gt;=&#39;A&#39; &amp;&amp; s.charAt(i) &lt;=&#39;C&#39;) n+= 3;
            if (s.charAt(i)&gt;= &#39;D&#39; &amp;&amp; s.charAt(i) &lt;= &#39;F&#39;) n+= 4;
            if (s.charAt(i)&gt;= &#39;G&#39; &amp;&amp; s.charAt(i) &lt;= &#39;I&#39;) n+= 5;
            if (s.charAt(i)&gt;= &#39;J&#39; &amp;&amp; s.charAt(i) &lt;= &#39;L&#39;) n+= 6;
            if (s.charAt(i)&gt;= &#39;M&#39; &amp;&amp; s.charAt(i) &lt;= &#39;O&#39;) n+= 7;
            if (s.charAt(i)&gt;= &#39;P&#39; &amp;&amp; s.charAt(i) &lt;= &#39;S&#39;) n+= 8;
            if (s.charAt(i)&gt;= &#39;T&#39; &amp;&amp; s.charAt(i) &lt;= &#39;V&#39;) n+= 9;
            if (s.charAt(i)&gt;= &#39;W&#39; &amp;&amp; s.charAt(i) &lt;= &#39;Z&#39;) n+= 10;
        }
        System.out.println(n);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[상수]]></title>
            <link>https://velog.io/@ho_vi/%EC%83%81%EC%88%98</link>
            <guid>https://velog.io/@ho_vi/%EC%83%81%EC%88%98</guid>
            <pubDate>Tue, 30 May 2023 14:08:09 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>114700</td>
<td>79556</td>
<td>68196</td>
<td>69.976%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>상근이의 동생 상수는 수학을 정말 못한다. 상수는 숫자를 읽는데 문제가 있다. 이렇게 수학을 못하는 상수를 위해서 상근이는 수의 크기를 비교하는 문제를 내주었다. 상근이는 세 자리 수 두 개를 칠판에 써주었다. 그 다음에 크기가 큰 수를 말해보라고 했다.</p>
<p>상수는 수를 다른 사람과 다르게 거꾸로 읽는다. 예를 들어, 734와 893을 칠판에 적었다면, 상수는 이 수를 437과 398로 읽는다. 따라서, 상수는 두 수중 큰 수인 437을 큰 수라고 말할 것이다.</p>
<p>두 수가 주어졌을 때, 상수의 대답을 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 상근이가 칠판에 적은 두 수 A와 B가 주어진다. 두 수는 같지 않은 세 자리 수이며, 0이 포함되어 있지 않다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 상수의 대답을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>734 893
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>437
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>221 231
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>132
</code></pre><h2 id="예제-입력-3">예제 입력 3</h2>
<pre><code>839 237
</code></pre><h2 id="예제-출력-3">예제 출력 3</h2>
<pre><code>938</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.next();
        String s2 = sc.next();
        String reS1 = &quot;&quot;;
        String reS2 = &quot;&quot;;
        for (int i = s1.length()-1; i&gt;=0; i--){
            reS1 += s1.charAt(i);
            reS2 += s2.charAt(i);
        }
        System.out.println(Integer.parseInt(reS1) &gt; Integer.parseInt(reS2) ? reS1 : reS2);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[단어의 개수]]></title>
            <link>https://velog.io/@ho_vi/%EB%8B%A8%EC%96%B4%EC%9D%98-%EA%B0%9C%EC%88%98</link>
            <guid>https://velog.io/@ho_vi/%EB%8B%A8%EC%96%B4%EC%9D%98-%EA%B0%9C%EC%88%98</guid>
            <pubDate>Tue, 30 May 2023 14:07:45 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>2 초</td>
<td>128 MB</td>
<td>302207</td>
<td>95718</td>
<td>76590</td>
<td>32.412%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>영어 대소문자와 공백으로 이루어진 문자열이 주어진다. 이 문자열에는 몇 개의 단어가 있을까? 이를 구하는 프로그램을 작성하시오. 단, 한 단어가 여러 번 등장하면 등장한 횟수만큼 모두 세어야 한다.</p>
<h2 id="입력">입력</h2>
<p>첫 줄에 영어 대소문자와 공백으로 이루어진 문자열이 주어진다. 이 문자열의 길이는 1,000,000을 넘지 않는다. 단어는 공백 한 개로 구분되며, 공백이 연속해서 나오는 경우는 없다. 또한 문자열은 공백으로 시작하거나 끝날 수 있다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 단어의 개수를 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>The Curious Case of Benjamin Button
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>6
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code> The first character is a blank
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>6
</code></pre><h2 id="예제-입력-3">예제 입력 3</h2>
<pre><code>The last character is a blank
</code></pre><h2 id="예제-출력-3">예제 출력 3</h2>
<pre><code>6</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine().trim();
        int count = 1;
        for (int i = 0; i&lt;s.length(); i++){
            if (s.charAt(i) == &#39; &#39;) count++;
        }
        if (s == &quot;&quot;) {
            System.out.println(0);
        }else{
            System.out.println(count);
        }
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[문자열 반복]]></title>
            <link>https://velog.io/@ho_vi/%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%B0%98%EB%B3%B5</link>
            <guid>https://velog.io/@ho_vi/%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%B0%98%EB%B3%B5</guid>
            <pubDate>Tue, 30 May 2023 14:07:22 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>171486</td>
<td>86558</td>
<td>73775</td>
<td>50.412%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>문자열 S를 입력받은 후에, 각 문자를 R번 반복해 새 문자열 P를 만든 후 출력하는 프로그램을 작성하시오. 즉, 첫 번째 문자를 R번 반복하고, 두 번째 문자를 R번 반복하는 식으로 P를 만들면 된다. S에는 QR Code &quot;alphanumeric&quot; 문자만 들어있다.</p>
<p>QR Code &quot;alphanumeric&quot; 문자는 <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\$%*+-./:</code> 이다.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 테스트 케이스의 개수 T(1 ≤ T ≤ 1,000)가 주어진다. 각 테스트 케이스는 반복 횟수 R(1 ≤ R ≤ 8), 문자열 S가 공백으로 구분되어 주어진다. S의 길이는 적어도 1이며, 20글자를 넘지 않는다.</p>
<h2 id="출력">출력</h2>
<p>각 테스트 케이스에 대해 P를 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>2
3 ABC
5 /HTP
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>AAABBBCCC
/////HHHHHTTTTTPPPPP</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;
public class Main{

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int T = in.nextInt();
        for(int i = 0; i &lt; T; i++) {

            int R = in.nextInt();
            String S = in.next();

            for(int j = 0; j &lt; S.length(); j++) {
                for(int k = 0; k &lt; R; k++) {
                    System.out.print(S.charAt(j));
                }
            }

            System.out.println();
        }
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[알파벳 찾기]]></title>
            <link>https://velog.io/@ho_vi/%EC%95%8C%ED%8C%8C%EB%B2%B3-%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@ho_vi/%EC%95%8C%ED%8C%8C%EB%B2%B3-%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Tue, 30 May 2023 14:07:04 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>174007</td>
<td>92504</td>
<td>76284</td>
<td>53.031%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>알파벳 소문자로만 이루어진 단어 S가 주어진다. 각각의 알파벳에 대해서, 단어에 포함되어 있는 경우에는 처음 등장하는 위치를, 포함되어 있지 않은 경우에는 -1을 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 단어 S가 주어진다. 단어의 길이는 100을 넘지 않으며, 알파벳 소문자로만 이루어져 있다.</p>
<h2 id="출력">출력</h2>
<p>각각의 알파벳에 대해서, a가 처음 등장하는 위치, b가 처음 등장하는 위치, ... z가 처음 등장하는 위치를 공백으로 구분해서 출력한다.</p>
<p>만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출력한다. 단어의 첫 번째 글자는 0번째 위치이고, 두 번째 글자는 1번째 위치이다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>baekjoon
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>1 0 -1 -1 2 -1 -1 -1 -1 4 3 -1 -1 7 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int [26];
        String s = sc.nextLine();
        for(int a = 0; a&lt;arr.length; a++) {
            arr[a] = -1;
        }
        for (int i = 0; i&lt;s.length(); i++) {
            if (arr[i] == -1) arr[s.charAt(i)-&#39;a&#39;] = i;
        }
        for (int e : arr) System.out.print(e + &quot; &quot;);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[숫자의 합]]></title>
            <link>https://velog.io/@ho_vi/%EC%88%AB%EC%9E%90%EC%9D%98-%ED%95%A9</link>
            <guid>https://velog.io/@ho_vi/%EC%88%AB%EC%9E%90%EC%9D%98-%ED%95%A9</guid>
            <pubDate>Tue, 30 May 2023 14:06:46 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>196823</td>
<td>107582</td>
<td>89535</td>
<td>55.331%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>N개의 숫자가 공백 없이 쓰여있다. 이 숫자를 모두 합해서 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 숫자의 개수 N (1 ≤ N ≤ 100)이 주어진다. 둘째 줄에 숫자 N개가 공백없이 주어진다.</p>
<h2 id="출력">출력</h2>
<p>입력으로 주어진 숫자 N개의 합을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>1
1
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>1
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>5
54321
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>15
</code></pre><h2 id="예제-입력-3">예제 입력 3</h2>
<pre><code>25
7000000000000000000000000
</code></pre><h2 id="예제-출력-3">예제 출력 3</h2>
<pre><code>7
</code></pre><h2 id="예제-입력-4">예제 입력 4</h2>
<pre><code>11
10987654321
</code></pre><h2 id="예제-출력-4">예제 출력 4</h2>
<pre><code>46</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        String num = sc.nextLine();
        int sum = 0;
        char a;
        for (int i=0;i &lt; n; i++) {
            a =  num.charAt(i);
            sum += a-&#39;0&#39;;
        }
        System.out.println(sum);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[아스키 코드]]></title>
            <link>https://velog.io/@ho_vi/%EC%95%84%EC%8A%A4%ED%82%A4-%EC%BD%94%EB%93%9C</link>
            <guid>https://velog.io/@ho_vi/%EC%95%84%EC%8A%A4%ED%82%A4-%EC%BD%94%EB%93%9C</guid>
            <pubDate>Tue, 30 May 2023 14:06:26 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>121685</td>
<td>96525</td>
<td>85017</td>
<td>80.350%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>알파벳 소문자, 대문자, 숫자 0-9중 하나가 주어졌을 때, 주어진 글자의 아스키 코드값을 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>알파벳 소문자, 대문자, 숫자 0-9 중 하나가 첫째 줄에 주어진다.</p>
<h2 id="출력">출력</h2>
<p>입력으로 주어진 글자의 아스키 코드 값을 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>A
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>65
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>C
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>67
</code></pre><h2 id="예제-입력-3">예제 입력 3</h2>
<pre><code>0
</code></pre><h2 id="예제-출력-3">예제 출력 3</h2>
<pre><code>48
</code></pre><h2 id="예제-입력-4">예제 입력 4</h2>
<pre><code>9
</code></pre><h2 id="예제-출력-4">예제 출력 4</h2>
<pre><code>57
</code></pre><h2 id="예제-입력-5">예제 입력 5</h2>
<pre><code>a
</code></pre><h2 id="예제-출력-5">예제 출력 5</h2>
<pre><code>97
</code></pre><h2 id="예제-입력-6">예제 입력 6</h2>
<pre><code>z
</code></pre><h2 id="예제-출력-6">예제 출력 6</h2>
<pre><code>122</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char a = sc.nextLine().charAt(0);
        System.out.println((int)a);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[문자열]]></title>
            <link>https://velog.io/@ho_vi/%EB%AC%B8%EC%9E%90%EC%97%B4</link>
            <guid>https://velog.io/@ho_vi/%EB%AC%B8%EC%9E%90%EC%97%B4</guid>
            <pubDate>Tue, 30 May 2023 14:06:04 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>21187</td>
<td>14912</td>
<td>13819</td>
<td>71.508%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>문자열을 입력으로 주면 문자열의 첫 글자와 마지막 글자를 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>입력의 첫 줄에는 테스트 케이스의 개수 T(1 ≤ T ≤ 10)가 주어진다. 각 테스트 케이스는 한 줄에 하나의 문자열이 주어진다. 문자열은 알파벳 A~Z 대문자로 이루어지며 알파벳 사이에 공백은 없으며 문자열의 길이는 1000보다 작다.</p>
<h2 id="출력">출력</h2>
<p>각 테스트 케이스에 대해서 주어진 문자열의 첫 글자와 마지막 글자를 연속하여 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>3
ACDKJFOWIEGHE
O
AB
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>AE
OO
AB</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String st;
        char a;
        char b;
        for (int i = 0; i&lt;n; i++) {
            st = sc.next();
            a = st.charAt(0);
            b = st.charAt(st.length()-1);
            System.out.print(a);
            System.out.println(b);
        }
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[단어 길이 재기]]></title>
            <link>https://velog.io/@ho_vi/%EB%8B%A8%EC%96%B4-%EA%B8%B8%EC%9D%B4-%EC%9E%AC%EA%B8%B0</link>
            <guid>https://velog.io/@ho_vi/%EB%8B%A8%EC%96%B4-%EA%B8%B8%EC%9D%B4-%EC%9E%AC%EA%B8%B0</guid>
            <pubDate>Tue, 30 May 2023 14:05:44 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>128 MB</td>
<td>35482</td>
<td>28891</td>
<td>26139</td>
<td>82.823%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 영어 소문자와 대문자로만 이루어진 단어가 주어진다. 단어의 길이는 최대 100이다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 입력으로 주어진 단어의 길이를 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>pulljima
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>8</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        String S = sc.nextLine();
        System.out.println(S.length());
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[문자와 문자열]]></title>
            <link>https://velog.io/@ho_vi/%EB%AC%B8%EC%9E%90%EC%99%80-%EB%AC%B8%EC%9E%90%EC%97%B4</link>
            <guid>https://velog.io/@ho_vi/%EB%AC%B8%EC%9E%90%EC%99%80-%EB%AC%B8%EC%9E%90%EC%97%B4</guid>
            <pubDate>Tue, 30 May 2023 14:05:19 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>1024 MB</td>
<td>7954</td>
<td>5438</td>
<td>5018</td>
<td>70.280%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>단어 S와 정수 i가 주어졌을 때, S의 i번째 글자를 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 S가 주어진다. 단어의 길이는 최대 1000이다.</p>
<p>둘째 줄에 정수 i가 주어진다. (1≤ i ≤  |S|)</p>
<h2 id="출력">출력</h2>
<p>S의 i번째 글자를 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>Sprout
3
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>r
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>shiftpsh
6
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>p
</code></pre><h2 id="예제-입력-3">예제 입력 3</h2>
<pre><code>Baekjoon
4
</code></pre><h2 id="예제-출력-3">예제 출력 3</h2>
<pre><code>k
</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        String s = sc.nextLine();
        int i = sc.nextInt();
        System.out.println(s.charAt(i-1));

    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[평균]]></title>
            <link>https://velog.io/@ho_vi/%ED%8F%89%EA%B7%A0</link>
            <guid>https://velog.io/@ho_vi/%ED%8F%89%EA%B7%A0</guid>
            <pubDate>Tue, 30 May 2023 14:04:40 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>2 초</td>
<td>128 MB</td>
<td>216395</td>
<td>107543</td>
<td>88461</td>
<td>49.386%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>세준이는 기말고사를 망쳤다. 세준이는 점수를 조작해서 집에 가져가기로 했다. 일단 세준이는 자기 점수 중에 최댓값을 골랐다. 이 값을 M이라고 한다. 그리고 나서 모든 점수를 점수/M*100으로 고쳤다.</p>
<p>예를 들어, 세준이의 최고점이 70이고, 수학점수가 50이었으면 수학점수는 50/70*100이 되어 71.43점이 된다.</p>
<p>세준이의 성적을 위의 방법대로 새로 계산했을 때, 새로운 평균을 구하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 시험 본 과목의 개수 N이 주어진다. 이 값은 1000보다 작거나 같다. 둘째 줄에 세준이의 현재 성적이 주어진다. 이 값은 100보다 작거나 같은 음이 아닌 정수이고, 적어도 하나의 값은 0보다 크다.</p>
<h2 id="출력">출력</h2>
<p>첫째 줄에 새로운 평균을 출력한다. 실제 정답과 출력값의 절대오차 또는 상대오차가 10-2 이하이면 정답이다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>3
40 80 60
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>75.0
</code></pre><h2 id="예제-입력-2">예제 입력 2</h2>
<pre><code>3
10 20 30
</code></pre><h2 id="예제-출력-2">예제 출력 2</h2>
<pre><code>66.666667
</code></pre><p>10-2 이하의 오차를 허용한다는 말은 정확히 소수 2번째 자리까지 출력하라는 뜻이 아니다.</p>
<h2 id="예제-입력-3">예제 입력 3</h2>
<pre><code>4
1 100 100 100
</code></pre><h2 id="예제-출력-3">예제 출력 3</h2>
<pre><code>75.25
</code></pre><h2 id="예제-입력-4">예제 입력 4</h2>
<pre><code>5
1 2 4 8 16
</code></pre><h2 id="예제-출력-4">예제 출력 4</h2>
<pre><code>38.75
</code></pre><h2 id="예제-입력-5">예제 입력 5</h2>
<pre><code>2
3 10
</code></pre><h2 id="예제-출력-5">예제 출력 5</h2>
<pre><code>65.0
</code></pre><h2 id="예제-입력-6">예제 입력 6</h2>
<pre><code>4
10 20 0 100
</code></pre><h2 id="예제-출력-6">예제 출력 6</h2>
<pre><code>32.5
</code></pre><h2 id="예제-입력-7">예제 입력 7</h2>
<pre><code>1
50
</code></pre><h2 id="예제-출력-7">예제 출력 7</h2>
<pre><code>100.0
</code></pre><h2 id="예제-입력-8">예제 입력 8</h2>
<pre><code>9
10 20 30 40 50 60 70 80 90
</code></pre><h2 id="예제-출력-8">예제 출력 8</h2>
<pre><code>55.55555555555556</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int arr[] = new int[sc.nextInt()];
        for (int i = 0; i&lt;arr.length; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        System.out.print(arr[0]+&quot; &quot;+arr[arr.length-1]);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[바구니 뒤집기]]></title>
            <link>https://velog.io/@ho_vi/%EB%B0%94%EA%B5%AC%EB%8B%88-%EB%92%A4%EC%A7%91%EA%B8%B0</link>
            <guid>https://velog.io/@ho_vi/%EB%B0%94%EA%B5%AC%EB%8B%88-%EB%92%A4%EC%A7%91%EA%B8%B0</guid>
            <pubDate>Tue, 30 May 2023 14:04:16 GMT</pubDate>
            <description><![CDATA[<table>
<thead>
<tr>
<th>시간 제한</th>
<th>메모리 제한</th>
<th>제출</th>
<th>정답</th>
<th>맞힌 사람</th>
<th>정답 비율</th>
</tr>
</thead>
<tbody><tr>
<td>1 초</td>
<td>256 MB</td>
<td>11000</td>
<td>6660</td>
<td>6094</td>
<td>62.439%</td>
</tr>
</tbody></table>
<h2 id="문제">문제</h2>
<p>도현이는 바구니를 총 N개 가지고 있고, 각각의 바구니에는 1번부터 N번까지 번호가 순서대로 적혀져 있다. 바구니는 일렬로 놓여져 있고, 가장 왼쪽 바구니를 1번째 바구니, 그 다음 바구니를 2번째 바구니, ..., 가장 오른쪽 바구니를 N번째 바구니라고 부른다.</p>
<p>도현이는 앞으로 M번 바구니의 순서를 역순으로 만들려고 한다. 도현이는 한 번 순서를 역순으로 바꿀 때, 순서를 역순으로 만들 범위를 정하고, 그 범위에 들어있는 바구니의 순서를 역순으로 만든다.</p>
<p>바구니의 순서를 어떻게 바꿀지 주어졌을 때, M번 바구니의 순서를 역순으로 만든 다음, 바구니에 적혀있는 번호를 가장 왼쪽 바구니부터 출력하는 프로그램을 작성하시오.</p>
<h2 id="입력">입력</h2>
<p>첫째 줄에 N (1 ≤ N ≤ 100)과 M (1 ≤ M ≤ 100)이 주어진다.</p>
<p>둘째 줄부터 M개의 줄에는 바구니의 순서를 역순으로 만드는 방법이 주어진다. 방법은 i j로 나타내고, 왼쪽으로부터 i번째 바구니부터 j번째 바구니의 순서를 역순으로 만든다는 뜻이다. (1 ≤ i ≤ j ≤ N)</p>
<p>도현이는 입력으로 주어진 순서대로 바구니의 순서를 바꾼다.</p>
<h2 id="출력">출력</h2>
<p>모든 순서를 바꾼 다음에, 가장 왼쪽에 있는 바구니부터 바구니에 적혀있는 순서를 공백으로 구분해 출력한다.</p>
<h2 id="예제-입력-1">예제 입력 1</h2>
<pre><code>5 4
1 2
3 4
1 4
2 2
</code></pre><h2 id="예제-출력-1">예제 출력 1</h2>
<pre><code>3 4 1 2 5</code></pre><h2 id="풀이">풀이</h2>
<pre><code class="language-java">import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr = new int[n];
        int i;
        int j;
        int rever;
        for (int b = 1; b&lt;=n; b++) {
            arr[b-1] = b;
        }
        for (int a = 0; a&lt;m; a++) {
            i = sc.nextInt();
            j = sc.nextInt();
            for (int c = i-1, d = j-1; d&gt;c; d--, c++) {
                rever = arr[d];
                arr[d] = arr[c];
                arr[c] = rever;
            }
        }
        for (int e : arr) System.out.print(e+&quot; &quot;);
    }
}</code></pre>
]]></description>
        </item>
    </channel>
</rss>