<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>joo.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Wed, 05 Nov 2025 12:26:48 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <copyright>Copyright (C) 2019. joo.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/alsk_so" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[프로그래머스] Lv. 0 특수문자 출력하기]]></title>
            <link>https://velog.io/@alsk_so/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%8A%B9%EC%88%98%EB%AC%B8%EC%9E%90-%EC%B6%9C%EB%A0%A5%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@alsk_so/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%8A%B9%EC%88%98%EB%AC%B8%EC%9E%90-%EC%B6%9C%EB%A0%A5%ED%95%98%EA%B8%B0</guid>
            <pubDate>Wed, 05 Nov 2025 12:26:48 GMT</pubDate>
            <description><![CDATA[<h2 id="문제">문제</h2>
<p><img src="https://velog.velcdn.com/images/alsk_so/post/77072d3f-164c-4b97-878c-f7384b1265bd/image.png" alt=""></p>
<h2 id="정답">정답</h2>
<ol>
<li><p>&#39;&quot; 과 같은 특수문자에 (백슬래쉬)붙여서 표현하기</p>
<pre><code class="language-python">print(&quot;!@#$%^&amp;*(\\\&#39;\&quot;&lt;&gt;?:;&quot;)</code></pre>
</li>
<li><p>r을 맨 앞에 붙이기</p>
<pre><code class="language-python">print(r&quot;!@#$%^&amp;*(\\\&#39;\&quot;&lt;&gt;?:;&quot;)</code></pre>
</li>
</ol>
<ul>
<li>백슬래쉬를 붙여서 표현해야하는 특수문자들도 r을 붙이면 해결가능하다.</li>
</ul>
<hr>
<h2 id="특수문자-종류">특수문자 종류</h2>
<pre><code class="language-python">&quot;\t&quot; # 탭
&quot;\n&quot; # 줄바꿈
&quot;\\&quot; # \(백슬래쉬)
&quot;\&#39;&quot; # &#39;(작은따옴표)
&quot;\&quot;&quot; # &quot;(큰따옴표)
</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CHAPTER 06] 연습문제 해답]]></title>
            <link>https://velog.io/@alsk_so/CHAPTER-06-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C-%ED%95%B4%EB%8B%B5</link>
            <guid>https://velog.io/@alsk_so/CHAPTER-06-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C-%ED%95%B4%EB%8B%B5</guid>
            <pubDate>Tue, 02 Jul 2024 15:43:12 GMT</pubDate>
            <description><![CDATA[<p><code>비주얼 스튜디오로 작성한 코드임을 참고해주세요😊</code>
</br></p>
<h3 id="01">01</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a, b;

    printf(&quot;정수를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;a);
    printf(&quot;정수를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;b);

    if (a % b == 0)
        printf(&quot;약수입니다.&quot;);
    else
        printf(&quot;약수가 아닙니다.&quot;);

    return 0;
}</code></pre>
<h3 id="02">02</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a, b, c, min;
    printf(&quot;정수 3개를 입력하시오: &quot;);
    scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c);

    if (a &gt;= b)
        if (b &gt;= c)
            min = c;
        else
            min = b;
    else if (a &gt;= c)
        min = c;
    else
        min = a;

    printf(&quot;제일 작은 정수는 %d입니다.&quot;, min);

    return 0;
}</code></pre>
<h3 id="03">03</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;
# include &lt;stdlib.h&gt;
# include &lt;time.h&gt;

int main(void)
{
    int computer, user;

    printf(&quot;(1:가위 2:바위 3:보) 중에서 하나를 선택하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;user);

    srand(time(NULL));
    computer = 1 + rand() % 3;

    if (computer == 1) {
        printf(&quot;컴퓨터는 가위를 선택하였습니다\n&quot;);
        printf(&quot;\n&quot;);

        if (user == 2)
            printf(&quot;사용자가 이겼습니다&quot;);
        else if(user == 3)
            printf(&quot;사용자가 졌습니다&quot;);
        else
            printf(&quot;비겼습니다&quot;);
    }
    else if (computer == 2) {
        printf(&quot;컴퓨터는 바위를 선택하였습니다\n&quot;);
        printf(&quot;\n&quot;);

        if(user == 1)
            printf(&quot;사용자가 졌습니다&quot;);
        else if(user == 3)
            printf(&quot;사용자가 이겼습니다&quot;);
        else 
            printf(&quot;비겼습니다&quot;);
    }
    else {
        printf(&quot;컴퓨터는 보를 선택하였습니다\n&quot;);
        printf(&quot;\n&quot;);

        if(user == 1)
            printf(&quot;사용자가 이겼습니다&quot;);
        else if(user == 2)
            printf(&quot;사용자가 졌습니다&quot;);
        else
            printf(&quot;비겼습니다&quot;);
    }

    return 0;
}</code></pre>
<h3 id="04">04</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float height;
    int age;

    printf(&quot;키를 입력하시오(cm): &quot;);
    scanf(&quot;%f&quot;, &amp;height);
    printf(&quot;나이를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;age);
    printf(&quot;\n&quot;);

    if (height &gt;= 140 &amp;&amp; age &gt;= 10)
        printf(&quot;타도 좋습니다&quot;);
    else
        printf(&quot;죄송합니다&quot;);

    return 0;
}</code></pre>
<h3 id="05">05</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int month;
    printf(&quot;월 번호를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;month);

    switch (month)
    {
    case 1:  printf(&quot;Jan\n&quot;); break;
    case 2:  printf(&quot;Feb\n&quot;); break;
    case 3:  printf(&quot;Mar\n&quot;); break;
    case 4:  printf(&quot;Apr\n&quot;); break;
    case 5:  printf(&quot;May\n&quot;); break;
    case 6:  printf(&quot;Jun\n&quot;); break;
    case 7:  printf(&quot;Jul\n&quot;); break;
    case 8:  printf(&quot;Aug\n&quot;); break;
    case 9:  printf(&quot;Sep\n&quot;); break;
    case 10:  printf(&quot;Oct\n&quot;); break;
    case 11:  printf(&quot;Nov\n&quot;); break;
    case 12:  printf(&quot;Dev\n&quot;); break;
    default:  printf(&quot;잘못입력하셨네요\n&quot;); break;
    }

    return 0;
}</code></pre>
<h3 id="06">06</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    char c;
    printf(&quot;문자를 입력하시오: &quot;);
    c = getchar();

    switch (c)
    {
    case &#39;a&#39;: case &#39;A&#39;:
    case &#39;e&#39;: case &#39;E&#39;:
    case &#39;o&#39;: case &#39;O&#39;:
    case &#39;i&#39;: case &#39;I&#39;:
    case &#39;u&#39;: case &#39;U&#39;:
        printf(&quot;모음입니다\n&quot;); break;
    default:
        printf(&quot;자음입니다\n&quot;);
        break;
    }

    return 0;
}</code></pre>
<h3 id="07">07</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float height, weight, result;

    printf(&quot;체중과 키를 입력하시오: &quot;);
    scanf(&quot;%f %f&quot;, &amp;weight, &amp;height);

    result = (height - 100) * 0.9;

    if (result &lt; height)
        printf(&quot;과체중입니다.&quot;);
    else if (result &gt; height)
        printf(&quot;저체중입니다.&quot;);
    else
        printf(&quot;정상입니다.&quot;);

    return 0;
}</code></pre>
<h3 id="08">08</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int time, age, fee;

    printf(&quot;현재 시간과 나이를 입력하시오(시간 나이): &quot;);
    scanf(&quot;%d %d&quot;, &amp;time, &amp;age);

    if (time &lt; 17) {
        if ((age &gt;= 3 &amp;&amp; age &lt;= 12) || age &gt;= 65)
            fee = 25000;
        else
            fee = 34000;
    }
    else {
        fee = 10000;
    }

    printf(&quot;요금은 %d원 입니다.&quot;, fee);

    return 0;
}</code></pre>
<h3 id="09">09</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float x, result;

    printf(&quot;x의 값을 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;x);

    if (x &lt;= 0)
        result = (x * x) - 9 * x + 2;
    else
        result = 7 * x + 2;

    printf(&quot;f(x)의 값은 %.2f 입니다&quot;, result);

    return 0;
}</code></pre>
<h3 id="10">10</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float x, y;
    printf(&quot;x, y좌표를 입력하시오: &quot;);
    scanf(&quot;%f %f&quot;, &amp;x, &amp;y);

    if (x &gt; 0 &amp;&amp; y &gt; 0)
        printf(&quot;1사분면입니다\n&quot;);
    else if (x &gt; 0 &amp;&amp; y &lt; 0)
        printf(&quot;4사분면입니다\n&quot;);
    else if (x  &lt;0 &amp;&amp; y &gt; 0)
        printf(&quot;2사분면입니다\n&quot;);
    else
        printf(&quot;3사분면입니다\n&quot;);

    return 0;
}</code></pre>
<h3 id="11">11</h3>
<pre><code class="language-c">#include &lt;stdio.h&gt;
int main(void)
{
    char c;
    printf(&quot;문자를 입력하시오: &quot;);
    c = getchar();
    switch (c) {
    case &#39;C&#39;:
    case &#39;c&#39;:
        printf(&quot;Circle \n&quot;); break;
    case &#39;T&#39;:
    case &#39;t&#39;:
        printf(&quot;Triangle \n&quot;); break;
    case &#39;R&#39;:
    case &#39;r&#39;:
        printf(&quot;Rectangle \n&quot;); break;
    default: 
        printf(&quot;Unknown \n&quot;); break;
    }

    return 0;
}</code></pre>
<h3 id="12">12</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;
# include &lt;stdlib.h&gt;
# include &lt;time.h&gt;

int main(void)
{
    int input_num, lucky_num, digit1, digit2, digit1L, digit2L;

    printf(&quot;복권 번호를 입력하시오(0에서 99사이): &quot;);
    scanf(&quot;%d&quot;, &amp;input_num);

    srand(time(NULL));
    lucky_num = rand() % 100;
    printf(&quot;당첨번호는 %d입니다.\n&quot;, lucky_num);

    digit1 = input_num / 10;
    digit2 = input_num % 10;
    digit1L = lucky_num / 10;
    digit2L = lucky_num % 10;

    if ((digit1 == digit1L) &amp;&amp; (digit2 == digit2L))
        printf(&quot;상금은 100만원입니다\n&quot;);
    else if ((digit1 == digit1L) || (digit2 == digit2L))
        printf(&quot;상금은 50만원입니다,\n&quot;);
    else
        printf(&quot;상금은 없습니다.\n&quot;);

    return 0;
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CHAPTER 05] 연습문제 해답]]></title>
            <link>https://velog.io/@alsk_so/CHAPTER-05-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C-%ED%95%B4%EB%8B%B5</link>
            <guid>https://velog.io/@alsk_so/CHAPTER-05-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C-%ED%95%B4%EB%8B%B5</guid>
            <pubDate>Mon, 01 Jul 2024 09:06:27 GMT</pubDate>
            <description><![CDATA[<p><code>비주얼 스튜디오로 작성한 코드임을 참고해주세요😊</code>
</br></p>
<h3 id="01">01</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a, b;

    printf(&quot;정수 2개를 입력하시오: &quot;);
    scanf(&quot;%d %d&quot;, &amp;a, &amp;b);

    printf(&quot;\n&quot;);
    printf(&quot;몫: %d\n&quot;, a / b);
    printf(&quot;나머지: %d\n&quot;, a % b);

    return 0;
}</code></pre>
<h3 id="02">02</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float a, b;
    printf(&quot;실수를 입력하시오: &quot;);
    scanf(&quot;%f %f\n&quot;, &amp;a, &amp;b);

    printf(&quot;%.2f %.2f %.2f %.2f\n&quot;, a + b, a - b, a * b, a / b);

    return 0;
}</code></pre>
<h3 id="03">03</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a, b, c, max;
    printf(&quot;정수 3개를 입력하시오: &quot;);
    scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c);

    (a &gt; b) ? (max = a) : (max = b);
    (max &gt; c) ? (max) : (max = c);

    printf(&quot;최대값은 %d입니다\n&quot;, max);

    return 0;
}</code></pre>
<h3 id="04">04</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float height, inch;
    int peet;

    printf(&quot;키를 입력하시오(cm): &quot;);
    scanf(&quot;%f&quot;, &amp;height);

    peet = height / (12 * 2.54);
    inch = (height / 2.54) - (12 * peet);

    printf(&quot;%.1f는 %d피트 %.2f인치입니다\n&quot;, height, peet, inch);

    return 0;
}</code></pre>
<h3 id="05">05</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int n;
    printf(&quot;정수를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;n);

    printf(&quot;\n&quot;);
    printf(&quot;십의 자리: %d\n&quot;, n / 10);
    printf(&quot;일의 자리: %d\n&quot;, n % 10);

    return 0;
}</code></pre>
<h3 id="06">06</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;
# include &lt;math.h&gt;

int main(void)
{
    double x, y;
    x = 1.0; y = 0.9;

    printf(&quot;(1.0-0.9)==0.1 은 %d 입니다&quot;, fabs(x - y-0.1) &lt; 0.0001);

    return 0;
}</code></pre>
<h3 id="07">07</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a, n;

    printf(&quot;정수를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;a);
    printf(&quot;2를 곱하고 싶은 횟수: &quot;);
    scanf(&quot;%d&quot;, &amp;n);

    printf(&quot;\n&quot;);
    printf(&quot;%d&lt;&lt;%d의 값: %d\n&quot;, a, n, a&lt;&lt;n);

    return 0;
}</code></pre>
<h3 id="08">08</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;
# define PI 3.14159

int main(void)
{
    float r, area, sphere;

    printf(&quot;구의 반지름을 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;r);

    area = 4.0 * PI * r * r;
    sphere = (4.0 / 3.0) * PI * r * r * r;

    printf(&quot;표면적은 %.2f입니다.\n&quot;, area);
    printf(&quot;체적은 %.2f입니다.\n&quot;, sphere);

    return 0;
}</code></pre>
<h3 id="09">09</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float cane_shadow_length, distance_to_pyramid, pyramid_height, cane_length;

    printf(&quot;지팡이의 높이를 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;cane_length);
    printf(&quot;지팡이 그림자의 길이를 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;cane_shadow_length);
    printf(&quot;피라미드까지의 거리를 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;distance_to_pyramid);

    pyramid_height = (distance_to_pyramid * cane_length) / cane_shadow_length;

    printf(&quot;피라미드의 높이는 %.2f입니다.&quot;, pyramid_height);

    return 0;
}</code></pre>
<h3 id="10">10</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;
int main(void)
{
    int x, y;

    printf(&quot;x좌표를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;x);
    printf(&quot;y좌표를 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;y);
    printf(&quot;\n&quot;);

    (x &gt; 0 &amp;&amp; y &gt; 0) ? printf(&quot;제1사분면입니다&quot;) : printf(&quot;&quot;);
    (x &gt; 0 &amp;&amp; y &lt; 0) ? printf(&quot;제4사분면입니다&quot;) : printf(&quot;&quot;);
    (x &lt; 0 &amp;&amp; y &gt; 0) ? printf(&quot;제2사분면입니다&quot;) : printf(&quot;&quot;);
    (x &lt; 0 &amp;&amp; y &lt; 0) ? printf(&quot;제3사분면입니다&quot;) : printf(&quot;&quot;);

    return 0;
}</code></pre>
<h3 id="11">11</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    double dist, degree, circ, radius;

    printf(&quot;거리를 입력하시오: &quot;);
    scanf(&quot;%lf&quot;, &amp;dist);
    printf(&quot;각도를 입력하시오: &quot;);
    scanf(&quot;%lf&quot;, &amp;degree);

    circ = (dist / degree) * 360.0;
    radius = circ / (2.0 * 3.14);

    printf(&quot;지구의 반지름은 %.2lf입니다.&quot;, radius);

    return 0;</code></pre>
<h3 id="12">12</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    char a, b, c, d;
    unsigned int r;

    printf(&quot;첫 번쨰 문자를 입력하시오: &quot;); scanf(&quot; %c&quot;, &amp;a);
    r = a;
    printf(&quot;두 번째 문자를 입력하시오: &quot;); scanf(&quot; %c&quot;, &amp;b);
    r = b &lt;&lt; 8 | r;
    printf(&quot;세 번쨰 문자를 입력하시오: &quot;); scanf(&quot; %c&quot;, &amp;c);
    r = c &lt;&lt; 16 | r;
    printf(&quot;네 번째 문자를 입력하시오: &quot;); scanf(&quot; %c&quot;, &amp;d);
    r = d &lt;&lt; 24 | r;

    printf(&quot;결과값: %x&quot;, r);

    return 0;
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CHAPTER 04] 연습문제 해답]]></title>
            <link>https://velog.io/@alsk_so/CHAPTER-04-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C</link>
            <guid>https://velog.io/@alsk_so/CHAPTER-04-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C</guid>
            <pubDate>Wed, 26 Jun 2024 06:09:52 GMT</pubDate>
            <description><![CDATA[<p><code>비주얼 스튜디오로 작성한 코드임을 참고해주세요😊</code>
</br></p>
<h3 id="01">01</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float a;

    printf(&quot;실수를 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;a);

    printf(&quot;실수형식으로는 %f입니다\n&quot;, a);
    printf(&quot;지수형식으로는 %e입니다&quot;, a);

    return 0;
}</code></pre>
<h3 id="02">02</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a;

    printf(&quot;16진수 정수를 입력하시오: &quot;);
    scanf(&quot;%x&quot;, &amp;a);

    printf(&quot;8진수로는 %#o입니다\n&quot;, a);
    printf(&quot;10진수로는 %d입니다\n&quot;, a);
    printf(&quot;16진수로는 %#x입니다\n&quot;, a);

    return 0;
}</code></pre>
<h3 id="03">03</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int x = 10, y = 20;
    int temp;

    printf(&quot;x = %d y = %d\n&quot;, x, y);

    temp = y;
    y = x;
    x = temp;

    printf(&quot;x = %d y = %d\n&quot;, x, y);

    return 0;
}</code></pre>
<h3 id="04">04</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    double w, h, d;

    printf(&quot;상자의 가로 세로 높이를 한번에 입력: &quot;);
    scanf(&quot;%lf %lf %lf&quot;, &amp;w, &amp;h, &amp;d);

    printf(&quot;상자의 부피는 %lf입니다.&quot;, w * h * d);

    return 0;
}</code></pre>
<h3 id="05">05</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    const double SQMETER_PER_PYENG = 3.3058;
    int pyeng;
    double result;

    printf(&quot;평을 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;pyeng);

    result = pyeng * SQMETER_PER_PYENG;

    printf(&quot;%lf평방미터입니다.&quot;, result);

    return 0;
}</code></pre>
<h3 id="06">06</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    double result;

    result = 3.32e-3 + 9.76e-8;

    printf(&quot;%lf&quot;, result);

    return 0;
}</code></pre>
<h3 id="07">07</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    double weight, speed, E;

    printf(&quot;질량(kg): &quot;);
    scanf(&quot;%lf&quot;, &amp;weight);
    printf(&quot;속도(m/s): &quot;);
    scanf(&quot;%lf&quot;, &amp;speed);

    E = (weight * speed * speed) / 2.0;

    printf(&quot;운동에너지(J): %lf&quot;, E);

    return 0;
}</code></pre>
<h3 id="08">08</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int a;

    printf(&quot;아스키 코드값을 입력하시오: &quot;);
    scanf(&quot;%d&quot;, &amp;a);

    printf(&quot;문자: %c입니다&quot;, a);

    return 0;
}</code></pre>
<h3 id="09">09</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;%c %c %c&quot;, &#39;a&#39; + 1, &#39;a&#39; + 2, &#39;a&#39; + 3);

    return 0;
}</code></pre>
<h3 id="10">10</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;\a화재가 발생하였습니다\a&quot;);

    return 0;
}</code></pre>
<h3 id="11">11</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;\&quot;ASCII code\&quot;, \&#39;A\&#39;, \&#39;B\&#39;, \&#39;C\&#39; \n&quot;);
    printf(&quot;\\t \\a \\n&quot;);

    return 0;
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CHAPTER 03] 연습문제 해답]]></title>
            <link>https://velog.io/@alsk_so/CPATER-03-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C</link>
            <guid>https://velog.io/@alsk_so/CPATER-03-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C</guid>
            <pubDate>Wed, 26 Jun 2024 06:05:24 GMT</pubDate>
            <description><![CDATA[<p><code>비주얼 스튜디오로 작성한 코드임을 참고해주세요😊</code>
</br></p>
<h3 id="01">01</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    int monthM;
    float time;

    printf(&quot;연봉을 입력하시오(단위: 만원): &quot;);
    scanf(&quot;%d&quot;, &amp;monthM);

    time = 100000.0 / monthM;

    printf(&quot;10억을 모으는데 걸리는 시간(단위: 년): %.2f\n&quot;, time);

    return 0;
}</code></pre>
<h3 id="02">02</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float mile, meter;

    printf(&quot;마일을 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;mile);

    meter = mile * 1609.0;

    printf(&quot;%.1f 마일은 %.2f미터입니다.&quot;, mile, meter);

    return 0;
}</code></pre>
<h3 id="03">03</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float base, height, area;

    printf(&quot;삼각형의 밑면: &quot;);
    scanf(&quot;%f&quot;, &amp;base);
    printf(&quot;삼각형의 높이: &quot;);
    scanf(&quot;%f&quot;, &amp;height);

    area = (base * height) / 2.0;

    printf(&quot;삼각형의 넓이: %.2f\n&quot;, area);

    return 0;
}</code></pre>
<h3 id="04">04</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float tem_F, tem_C;

    printf(&quot;화씨값을 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;tem_F);

    tem_C = (5.0 / 9.0) * (tem_F - 32);

    printf(&quot;섭씨값은 %.2f도 입니다&quot;, tem_C);

    return 0;
}</code></pre>
<h3 id="05">05</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    float x, result;

    printf(&quot;실수를 입력하시오: &quot;);
    scanf(&quot;%f&quot;, &amp;x);

    result = 3 * x * x + 7 * x + 11;

    printf(&quot;다항식의 값은 %.2f&quot;, result);

    return 0;
}</code></pre>
<h3 id="06">06</h3>
<pre><code class="language-c"># define _CRT_SECURE_NO_WARNINGS
# include &lt;stdio.h&gt;

int main(void)
{
    double weight_on_earth, weight_on_moon;

    printf(&quot;몸무게를 입력하시오(단위: kg): &quot;);
    scanf(&quot;%lf&quot;, &amp;weight_on_earth);

    weight_on_moon = weight_on_earth * 0.17;

    printf(&quot;달에서의 몸무게는 %.2lfkg입니다.&quot;, weight_on_moon);

    return 0;
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CHAPTER 02] 연습문제 해답]]></title>
            <link>https://velog.io/@alsk_so/CHAPTER-02-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C</link>
            <guid>https://velog.io/@alsk_so/CHAPTER-02-%EC%97%B0%EC%8A%B5%EB%AC%B8%EC%A0%9C</guid>
            <pubDate>Wed, 26 Jun 2024 05:56:40 GMT</pubDate>
            <description><![CDATA[<p><code>비주얼 스튜디오로 작성한 코드임을 참고해주세요😊</code>
</br></p>
<h3 id="01">01</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;이름: 홍길동\n&quot;);
    printf(&quot;나이: 21살\n&quot;);
    printf(&quot;주소: 서울 200번지\n&quot;);

    return 0;
}</code></pre>
<h3 id="02">02</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;Hello\nC\nProgrammers!&quot;);

    return 0;
}</code></pre>
<h3 id="03">03</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;--------------------------------\n&quot;);
    printf(&quot;학과: 컴퓨터공학과\n&quot;);
    printf(&quot;학번: 0001\n&quot;);
    printf(&quot;성명: 홍길동\n&quot;);
    printf(&quot;--------------------------------\n&quot;);

    return 0;
}</code></pre>
<h3 id="04">04</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;일\t월\t화\t수\t목\t금\t토\n&quot;);
    printf(&quot;1\t2\t3\t4\t5\t6\t7\n&quot;);
    printf(&quot;8\t9\t10\t11\t12\t13\t14\n&quot;);
    printf(&quot;15\t16\t17\t18\t19\t20\t21\n&quot;);
    printf(&quot;22\t23\t24\t25\t26\t27\t28\n&quot;);
    printf(&quot;29\t30\t31\n&quot;);

    return 0; 
}</code></pre>
<h3 id="05">05</h3>
<pre><code class="language-c"># include &lt;stdio.h&gt;

int main(void)
{
    printf(&quot;7+8 = %d\n&quot;, 7 + 8);
    printf(&quot;7-8 = %d\n&quot;, 7 - 8);
    printf(&quot;7*8 = %d\n&quot;, 7 * 8);
    printf(&quot;7/8 = %d\n&quot;, 7 / 8);

    return 0;
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[BOJ-10833_사과 (Python)]]></title>
            <link>https://velog.io/@alsk_so/BOJ-10833%EC%82%AC%EA%B3%BC</link>
            <guid>https://velog.io/@alsk_so/BOJ-10833%EC%82%AC%EA%B3%BC</guid>
            <pubDate>Sun, 28 Jan 2024 14:20:30 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/alsk_so/post/99c1560f-9496-4de5-88be-aa6a8c2152da/image.png" alt=""></p>
<h2 id="🤚접근방법">🤚접근방법</h2>
<ul>
<li>남는 사과의 갯수를 어떻게 알아낼 것인지를 생각해야 한다.<h2 id="💡정답">💡정답</h2>
<pre><code class="language-python">n = int(input())  # 학교 수
answer = 0
</code></pre>
</li>
</ul>
<p>for i in range(n):
    students, apples = map(int, input().split())
    answer += apples % students</p>
<p>print(answer)</p>
<pre><code>### 📖 풀이
간단한 원리가 사용된다.
예로 들면 오븐시계나 시간을 구할 때 나머지와 몫을 이용하는 것을 이용하면 쉽게 문제에 접근이 가능하다.
즉, 배정된 사과 수를 학생 수로 나누어 준다면 남는 사과의 갯수를 알 수 있다. 

&lt;/br&gt;
* 처음 문제를 볼 때 너무 어렵게 접근하여 문제의 정답비율이 높은데도 왜 안풀릴까 생각을 했었는데  &lt;span style = &quot;color: Red&quot;&gt;남는 시간이라는 키워드&lt;/span&gt;에 집중하다보니 비슷한 문제유형이 떠오르면서 문제를 다른 시각으로 접근할 수 있었다.
</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[[python] EOF(End of File) 처리 방법]]></title>
            <link>https://velog.io/@alsk_so/python-EOFEnd-of-File-%EC%B2%98%EB%A6%AC-%EB%B0%A9%EB%B2%95</link>
            <guid>https://velog.io/@alsk_so/python-EOFEnd-of-File-%EC%B2%98%EB%A6%AC-%EB%B0%A9%EB%B2%95</guid>
            <pubDate>Thu, 18 Jan 2024 07:44:52 GMT</pubDate>
            <description><![CDATA[<h2 id="span-style--background-coloryelloweof란span"><span style = background-color:Yellow>EOF란?</span></h2>
<p> 컴퓨팅에서 파일의 끝(End of FIle)을 나타내고 데이터 소스로부터 더이상 읽을 수 있는 데이터가 없음을 의미.</p>
<hr>
<p>알고리즘 문제를 풀다가 입력의 끝을 EOF로 주는 경우를 보고 의문이 생겨 정리해보기로!</p>
<hr>
</br>

<h3 id="1-input인-경우">1. input()인 경우</h3>
<ul>
<li>try, except를 사용하여 input()으로 입력받을 경우에 EOF를 처리할 수 있다.</li>
</ul>
<pre><code class="language-python">while True:
    try:
        x = int(input())
        print(x)
    except:
        break
</code></pre>
<p>만약, 윈도우 환경이라면 Ctrl + z 를 누르면 처리가 가능하다.</p>
</br>

<h4 id="추가-sysstdinreadline">&gt;&gt; 추가 sys.stdin.readline()</h4>
<ul>
<li>추가로 알고리즘 문제를 풀다보면 빠른 입출력을 요구하거나 입력받는 수가 너무 많다면 input() 함수로 입력을 받는다면 <span style = color:Red>시간초과</span>라는 문제가 발생한다. (저의 경험담... 초창기에는 모르고 많이 헤맸답니다)</li>
</ul>
<ul>
<li>이때 sys.stdin.readline() 라이브러리 함수를 사용한다면 문제가 해결된다. <pre><code class="language-python">import sys
</code></pre>
</li>
</ul>
<p>x = int(sys.stdin.readline())
print(x)</p>
<p>```</p>
<blockquote>
<p>만약 입력받는 수가 정해져 있지 않는다면 EOF임을 인지하고 try, except를 사용하자!
개념을 이해하였다면 예제를 한번 풀어보는 것을 추천한다</p>
</blockquote>
<p><a href="https://www.acmicpc.net/problem/10951">baekjoon 10951번 - A+B-4</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[python] 최소공배수(LCM)]]></title>
            <link>https://velog.io/@alsk_so/python-%EC%B5%9C%EC%86%8C%EA%B3%B5%EB%B0%B0%EC%88%98LCM</link>
            <guid>https://velog.io/@alsk_so/python-%EC%B5%9C%EC%86%8C%EA%B3%B5%EB%B0%B0%EC%88%98LCM</guid>
            <pubDate>Wed, 17 Jan 2024 07:38:20 GMT</pubDate>
            <description><![CDATA[<h2 id="span-style--background-coloryellow최소공배수란span"><span style = background-color:Yellow>최소공배수란?</span></h2>
<ul>
<li>공배수(common multiple)란 두 수 이상의 공통된 여러 개의 배수를 의미한다.</li>
<li>최소공배수(LCM)란 두 수 이상의 공통된 여러 개의 공배수 중 최소인 수를 가리킨다.<h3 id="1-대표적인-방법">1. 대표적인 방법</h3>
<pre><code class="language-python">def lcm(a, b):
  for i in range(max(a, b), (a * b) + 1):
      if i % a == 0 and i % b == 0:
          return i</code></pre>
</br>

</li>
</ul>
<h3 id="2-최대공약수-활용방법">2. 최대공약수 활용방법</h3>
<ul>
<li><span style = color:Red>최소공배수 = (두 수의 곱) / 최대공약수</span><pre><code class="language-python">def gcd(a, b):
  while b &gt; 0:
      a, b = b, a % b
  return a
</code></pre>
</li>
</ul>
<p>def lcm(a, b):
    return (a * b) / gcd(a, b)</p>
<pre><code>or

``` python
import math

def lcm(a, b):
    return (a * b) / math.gcd(a, b)</code></pre></br>

<h3 id="3-파이썬-math-라이브러리-방법">3. 파이썬 math 라이브러리 방법</h3>
<pre><code class="language-python">import math

a, b = 5, 10
math.lcm(a, b)
</code></pre>
<ul>
<li>파이썬 3.9버전부터는 math 라이브러리를 사용하여 lcm을 바로 구할 수 있다.</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[python] 최대공약수(GCD), 유클리드 호제법]]></title>
            <link>https://velog.io/@alsk_so/python-%EC%B5%9C%EB%8C%80%EA%B3%B5%EC%95%BD%EC%88%98GCD</link>
            <guid>https://velog.io/@alsk_so/python-%EC%B5%9C%EB%8C%80%EA%B3%B5%EC%95%BD%EC%88%98GCD</guid>
            <pubDate>Tue, 16 Jan 2024 13:10:24 GMT</pubDate>
            <description><![CDATA[<h1 id="span-style--background-coloryellow최대공약수란gcdspan"><span style = 'background-color:yellow'>최대공약수란?(GCD)</span></h1>
<ul>
<li>공약수(common divisor)란 두 수 이상의 공통된 여러개의 약수를 의미한다.</li>
<li>최대공약수(GCD)란 두 수 이상의 공통된 여러개의 공약수 중 최대인 수를 가리킨다.</li>
</ul>
<h3 id="1-대표적인-방법">1. 대표적인 방법</h3>
<pre><code class="language-python">def gcd(a, b):
    for i in range(min(a, b), 0, -1):
        if a % i == 0 and b % i == 0:
            return i</code></pre>
<ul>
<li>min(a, b)로 a와 b를 나누면서 공통적으로 나머지가 0이 되는 약수가 있는지 확인하는 방법이다</br>
### 2. 파이썬 math 라이브러리 방법

</li>
</ul>
<pre><code class="language-python">import math
a, b = 5, 10
math.gcd(a, b)  # 5</code></pre>
<ul>
<li>파이썬 3.9버전부터는 math 라이브러리를 사용하여 gcd를 바로 구할 수 있다.</br>
</li>
</ul>
<hr>
</br>

<p><a href="https://www.acmicpc.net/problem/1850">baekjoon 1850_최대공약수</a></p>
<p>이 글을 쓴 큰 이유가 이 문제 때문인데
위의 2개의 방법을 써도 되지만 하나하나 수를 비교하는 것이기 때문에 <span style = 'color:Red'>시간초과</span>가 발생한다.
유클리드 호제법을 사용한다면 효율적으로 문제를 해결할 수 있다.</p>
<h2 id="span-style--background-coloryellow유클리드-호제법span"><span style = 'background-color:yellow'>유클리드 호제법?</span></h2>
<ul>
<li>두 자연수 a, b에 대하여 a를 b로 나눈 나머지 r에 대해서 a와 b의 최대공약수는 b와 r의 최대공약수와 같다. 
이와 같은 과정을 반복하여 b가 0이 될 때 a값이 최대공약수가 된다.</li>
</ul>
<pre><code class="language-python">def gcd(a, b):
    while b &gt; 0:
        a, b = b, a % b
    return a</code></pre>
<h4 id="백준-1850번-정답">백준 1850번 정답</h4>
<pre><code class="language-python">def gcd(a, b):
    while b &gt; 0:
        a, b = b, a % b
    return a

a, b = map(int, input().split())

print(&#39;1&#39; * gcd(a, b))</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[BOJ-3052_나머지 (Python)]]></title>
            <link>https://velog.io/@alsk_so/BOJ-3052%EB%82%98%EB%A8%B8%EC%A7%80</link>
            <guid>https://velog.io/@alsk_so/BOJ-3052%EB%82%98%EB%A8%B8%EC%A7%80</guid>
            <pubDate>Mon, 15 Jan 2024 07:04:30 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/alsk_so/post/518a18d6-ecb0-481d-b6a6-c89d0343d85c/image.png" alt=""></p>
<h2 id="🤚접근방법">🤚접근방법</h2>
<ul>
<li>서로 다른 나머지의 갯수를 구해야 함으로 같은 나머지를 제거하는 방법을 떠올려야 한다.</li>
</ul>
<h2 id="💡정답">💡정답</h2>
<pre><code class="language-python">num_list = [0] * 10 

for i in range(10):
    N = int(input())
    num_list[i] = N % 42

num_list = set(num_list)

print(len(num_list))</code></pre>
<h3 id="📖-풀이">📖 풀이</h3>
<p><span style = "color: Red">이 문제의 핵심은 같은 나머지를 제외하고 서로 다른 나머지의 갯수를 출력하는 것이다.</span></p>
<p>​
중복된 나머지를 제거하기 위하여</p>
<p><span style = "color: Red"> set(중복된 요소 제거)</span>  사용한다면 같은 나머지는 제거될 것이고 남은 것은 다른 나머지이기 때문에</p>
<p>최종적으로 num_list의 길이가 결과값인 서로 다른 나머지의 개수이다. 
<br/></p>
<p>set 함수는 python 시리즈에서 더 자세히 다루어보도록 하겠다.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[BOJ-2439_별 찍기(2) (Python)]]></title>
            <link>https://velog.io/@alsk_so/BOJ-2439%EB%B3%84-%EC%B0%8D%EA%B8%B02</link>
            <guid>https://velog.io/@alsk_so/BOJ-2439%EB%B3%84-%EC%B0%8D%EA%B8%B02</guid>
            <pubDate>Mon, 15 Jan 2024 06:56:12 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/alsk_so/post/6f45bc5b-ca99-464c-9ae4-ebb701dab74b/image.png" alt=""></p>
<h2 id="🤚접근방법">🤚접근방법</h2>
<ul>
<li>일반적인 별 찍기와는 달리 띄어쓰기가 별보다 앞에 배치되어 있음으로 빈칸을 어떤 식으로 구성할 것인지가 핵심이다.<h2 id="💡정답">💡정답</h2>
<pre><code class="language-python">n = int(input())
</code></pre>
</li>
</ul>
<p>for i in range(1, n+1):
    print(&quot; &quot; * (n-i) + &quot;*&quot; * i)</p>
<p>```</p>
<h3 id="📖-풀이">📖 풀이</h3>
<p>c언어로 별찍기를 접하여 문제를 어렵게 생각을 하였지만</p>
<p>파이썬은 훨씬 간단하게 문제를 풀 수 있다.</p>
<p><span style ="color: Red">&quot;&quot; * (n-i) 으로 빈칸을 만들고
 &quot;*&quot; * i 으로 별을 찍는다.
=  * 을 이용하여 파이썬은 빈칸과 별의 갯수를 조절할 수 있다.</span>
. </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[BOJ-2525_오븐시계 (Python)]]></title>
            <link>https://velog.io/@alsk_so/BOJ-2525%EC%98%A4%EB%B8%90%EC%8B%9C%EA%B3%84</link>
            <guid>https://velog.io/@alsk_so/BOJ-2525%EC%98%A4%EB%B8%90%EC%8B%9C%EA%B3%84</guid>
            <pubDate>Mon, 15 Jan 2024 06:38:43 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/alsk_so/post/2a053537-6c32-449e-bcdf-67cce70ee076/image.png" alt=""></p>
<h2 id="🤚접근방법">🤚접근방법</h2>
<ul>
<li>24시간제인 것을 유의해야 한다.<h2 id="💡정답">💡정답</h2>
<pre><code class="language-python">H, M = map(int, input(). split()) # 요리를 시작하는 시간 입력
needTime = int(input())  # 요리하는데 필요한 시간 입력
</code></pre>
</li>
</ul>
<p>c = M + needTime 
H += (c // 60)  # 새로운 시
M = (c % 60)     # 새로운 분</p>
<p>if H == 24:
    H = 0
elif H &gt; 24:
    H -= 24</p>
<p>print(H, M)</p>
<pre><code>### 📖풀이
c는 요리하는데 걸리는 시간과 현재 시간을 합친 것이다.

c를 60으로 나눈 몫은 현재 시와 합쳐지게 되고 c를 60으로 나눈 나머지는 새로운 &#39;분&#39;이 되게 된다.

&lt;br/&gt;

이 문제는 24시간제를 이용하고 있어

첫번째로 새로운 시가 24일 경우 0으로 바꿔주는 코드가 필요하다.

두번째로는 새로운 시가 24시를 넘어갈 경우에도 24시를 빼서 새벽시간을 올바르게 맞추어야 한다.

2개의 부분만 유의한다면 큰 어려움은 없는 문제이다. 



</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[BOJ-2884_알람시계 (Python)]]></title>
            <link>https://velog.io/@alsk_so/BOJ-2884</link>
            <guid>https://velog.io/@alsk_so/BOJ-2884</guid>
            <pubDate>Mon, 15 Jan 2024 06:24:52 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/alsk_so/post/beaf0ded-56c7-4a69-8668-ce6b29223a9e/image.png" alt=""></p>
<h2 id="🤚접근방법">🤚접근방법</h2>
<ul>
<li>이 문제에서는 24시간제를 이용하고 있음으로  시간이 바뀌었을 때를 유의하여 살펴봐야 한다.</li>
<li>이로 인해서 시와 분 조건을 나누어 코드를 만들어야 한다.</li>
</ul>
<h2 id="💡-정답-">💡** 정답 **</h2>
<pre><code class="language-python">time_H, time_M = map(int, input().split())

if 45 &lt;= time_M &lt;= 59:
    setTime = time_M - 45
    print(time_H, setTime)
else:
    setTime = 45 - time_M
    setTime_1 = 60 - setTime
    if time_H == 0:
        time_H = 23
    else:
        time_H -= 1

    print(time_H, setTime_1)
</code></pre>
<h3 id="📖-풀이">📖 풀이</h3>
<p>time_H(입력 시), time_M(입력 분)를 <span style = "color: Red">map</span>으로 받는다.</p>
<p>만약  time_M가 45분보다 크고 59분 보다 작다면 그냥 time_M에서 45분을 제외시키면 된다</p>
<p>하지만 여기서 조심해야할 부분은 -45분을 해야하기 때문에 <span style = "color: Red">&#39;시&#39;가 바뀌는 시점을 유의깊게 봐야 한다.</span></p>
<p>​</p>
<p>&#39;분&#39;을 구하기 위해서는 총 두번의 과정이 필요하다.</p>
<p>첫번째로  45 - time_M을 하여 &#39;시&#39;가 바뀌었을 때 새로운 60분에서 몇분을 제외시켜야 하는지 파악한다.</p>
<p>두번째로 제외시켜야 할 &#39;분&#39;이 파악이 되었음으로 새로운 60분에서 제외시킬 &#39;분&#39;을 빼주면 된다.</p>
<p>setTime = 제외시킬 &#39;분&#39;  /  setTime_1 = &#39;시&#39; 가 바뀌었을 때의 &#39;분&#39;</p>
<p>​</p>
<p>&#39;시&#39;를 구해야하는데 이 문제에서는 24시간제를 적용하여 자정이 0이 되므로</p>
<p>time_H 가 0(자정)이라면 23시로 바뀌게 하고</p>
<p>나머지 경우는 time_H - 1을 해주면 된다.</p>
<p>​</p>
<p> ※ 문제만 보면 어렵지만 <span style="color: red">예외들을 하나씩 생각해나가면</span> 손쉽게 푸는 것이 가능하다. </p>
]]></description>
        </item>
    </channel>
</rss>