{"id":8191,"date":"2008-10-11T10:39:00","date_gmt":"2008-10-11T10:39:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=8191"},"modified":"2008-10-11T10:39:00","modified_gmt":"2008-10-11T10:39:00","slug":"%ec%bb%b4%ed%93%a8%ed%84%b0%ea%b0%80-%eb%ac%b4%ec%a1%b0%ea%b1%b4-%ec%9d%b4%ea%b8%b0%eb%8a%94-%ea%b0%80%ec%9c%84%eb%b0%94%ec%9c%84%eb%b3%b4","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=8191","title":{"rendered":"\ucef4\ud4e8\ud130\uac00 \ubb34\uc870\uac74 \uc774\uae30\ub294 \uac00\uc704\ubc14\uc704\ubcf4"},"content":{"rendered":"<div class=\"desc\">\n        \uce5c\uad6c\uc758 \ubd80\ud0c1\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \uc92c\ub2e4. \ubb50&#8230;\uc774\ub7f0\uac70 \ud558\uba74 \uc548\ub418\ub294 \uac70\uaca0\uc9c0\ub9cc -_-;<\/p>\n<p>\n        #include<stdio.h> \/\/ scanf\uc640 printf\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \ud3ec\ud568\ub428<br \/>\n        <br \/>\n        #include<string.h> \/\/ strcpy\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \ud3ec\ud568\ub428<br \/>\n        <br \/>\n        #include<stdlib.h> \/\/ exit\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \ud3ec\ud568\ub428<\/p>\n<p>        int scissor(int); \/\/ \ucef4\ud4e8\ud130\uc758 \ud544\uc2b9 \uc804\ub7b5 \ud568\uc218<br \/>\n        <br \/>\n        int printing_choice(int , int ); \/\/ \ub204\uac00 \ubb34\uc5c7\uc744 \uace8\ub790\ub294\uc9c0 \uc54c\ub824\uc8fc\ub294 \ud568\uc218<br \/>\n        <br \/>\n        void winner(int ,int ); \/\/ \uc2b9\uc790\uac00 \ub204\uad6c\uc778\uc9c0 \ud310\uc815\ud558\ub294 \ud568\uc218<\/p>\n<p>        int main(void) \/\/ \uba85\ub839\uc904 \uc785\ub825\uac12 \uc5c6\uc74c<br \/>\n        <br \/>\n        {<br \/>\n        <br \/>\n        int g;<br \/>\n        <br \/>\n        printf(&#8220;Input your choice : &#8220;);<br \/>\n        <br \/>\n        scanf(&#8220;%d&#8221;,&#038;g); \/\/ \uc0ac\ub78c\uc758 \uc120\ud0dd\uc744 \uc785\ub825\ubc1b\uc544\uc11c \ubcc0\uc218 g\uc5d0 \uc800\uc7a5\ud55c\ub2e4<br \/>\n        <br \/>\n        printing_choice(1,g); \/\/ \uc0ac\ub78c\uc758 \uc120\ud0dd g\ub97c \ucd9c\ub825\ud55c\ub2e4<br \/>\n        <br \/>\n        printing_choice(2,scissor(g)); \/\/ scissor \ud568\uc218\uc5d0\uc11c \ub118\uaca8\ubc1b\uc740 \ucef4\ud4e8\ud130\uc758 \uc120\ud0dd\uc744 \ucd9c\ub825\ud55c\ub2e4<br \/>\n        <br \/>\n        winner(g,scissor(g)); \/\/ \uc0ac\ub78c\uc758 \uc120\ud0dd\uacfc \ucef4\ud4e8\ud130\uc758 \uc120\ud0dd\uc744 \ube44\uad50\ud558\uc5ec \uc2b9\uc790\ub97c \ucd9c\ub825\ud55c\ub2e4<br \/>\n        <br \/>\n        system(&#8220;PAUSE&#8221;);<br \/>\n        <br \/>\n        return 1; \/\/ \ud504\ub85c\uadf8\ub7a8 \uc885\ub8cc<br \/>\n        <br \/>\n        }<\/p>\n<p>        int scissor(int p){<br \/>\n        <br \/>\n        return (p%3)+1;<br \/>\n        <br \/>\n        \/\/ 3\uc73c\ub85c \ub098\ub208 \ub098\uba38\uc9c0\uc5d0 1\uc744 \ub354\ud558\uc600\uc73c\ubbc0\ub85c \uc774 \ud568\uc218\ub294 1, 2, 3\uc911\uc758 \ud558\ub098\ub97c \ubc18\ud658\ud55c\ub2e4.<br \/>\n        <br \/>\n        \/\/ \uc785\ub825\uac12 p\ubcf4\ub2e4 \ud56d\uc0c1 1\uc774 \ud06c\uae30 \ub54c\ubb38\uc5d0 \uc2b9\ub9ac \uc804\ub7b5\uc774 \ub41c\ub2e4.<br \/>\n        <br \/>\n        }<\/p>\n<p>        int printing_choice(int m, int p){<br \/>\n        <br \/>\n        char a[10],b[10];<br \/>\n        <br \/>\n        \/\/ \uc785\ub825\ubc1b\uc740 \uac12 m\uc774 1\uc774\uba74 \uc0ac\uc6a9\uc790\uc758 \uc785\ub825\uac12, 1\uc774 \uc544\ub2c8\uba74 \ucef4\ud4e8\ud130\uc758 \uc785\ub825\uac12\uc774\ub2e4.<\/p>\n<p>        if(m==1){<br \/>\n        <br \/>\n        strcpy(a,&#8221;You&#8221;);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        else {<br \/>\n        <br \/>\n        strcpy(a,&#8221;Machine&#8221;);<br \/>\n        <br \/>\n        }<\/p>\n<p>        \/\/ \uc785\ub825\ubc1b\uc740 \uac12 p\uac00 3\uc758 \ubc30\uc218\uc774\uba74 \uac00\uc704, 3\uc73c\ub85c \ub098\ub208 \ub098\uba38\uc9c0\uac00 1\uc774\uba74 \ubc14\uc704, 3\uc73c\ub85c \ub098\ub208 \ub098\uba38\uc9c0\uac00 2\uc774\uba74 \ubcf4\uc790\uae30\uc774\ub2e4.<br \/>\n        <br \/>\n        if(p%3==0){<br \/>\n        <br \/>\n        strcpy(b,&#8221;SCISSOR&#8221;);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        else if(p%3==1){<br \/>\n        <br \/>\n        strcpy(b,&#8221;ROCK&#8221;);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        else {<br \/>\n        <br \/>\n        strcpy(b,&#8221;PLAIN&#8221;);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        \/\/ \ub204\uad6c\uc758 \uc785\ub825\uac12\uc774 \ubb34\uc5c7\uc778\uc9c0 \ucd9c\ub825\ud55c\ub2e4<br \/>\n        <br \/>\n        printf(&#8220;%s select %s\\n&#8221;,a,b);<br \/>\n        <br \/>\n        }<\/p>\n<p>        void winner(int p,int q){<br \/>\n        <br \/>\n        char a[10];<br \/>\n        <br \/>\n        \/\/ \uac00\uc704\ub294 \ubcf4\uc790\uae30\uc5d0 \uc774\uae34\ub2e4. \uadf8\ub9ac\uace0 \ubcf4\uc790\uae30\ub294 \ubc14\uc704\uc5d0 \uc774\uae30\uace0 \ubc14\uc704\ub294 \uac00\uc704\uc5d0 \uc774\uae34\ub2e4.<br \/>\n        <br \/>\n        if((p%3==0&#038;&#038;q%3==2)||(p%3>q%3)){<br \/>\n        <br \/>\n        strcpy(a,&#8221;You win&#8221;);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        if((q%3==0&#038;&#038;p%3==2)||(p%3<q%3)){\n        <br \/>\n        strcpy(a,&#8221;You lose&#8221;);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        \/\/ \ub9cc\uc57d \uac12\uc774 \uac19\uc73c\uba74 \ub458\uc740 \ube44\uae34\ub2e4.<br \/>\n        <br \/>\n        if(p%3==q%3){<br \/>\n        <br \/>\n        printf(&#8220;No one win\\n&#8221;);<br \/>\n        <br \/>\n        exit(1);<br \/>\n        <br \/>\n        }<br \/>\n        <br \/>\n        \/\/ \ub204\uac00 \uc774\uacbc\ub294\uc9c0 \ucd9c\ub825\ud558\uace0 \ub05d\ub0b8\ub2e4.<br \/>\n        <br \/>\n        printf(&#8220;%s!\\n&#8221;);<br \/>\n        <br \/>\n        }<\/p>\n<div style=\"width:100%;margin-top:30px;clear:both;height:30px\">\n<div style=\"width:31px;float:left;\">\n<a href=\"\/toolbar\/popup\/abuseReport\/?entryId=994\" onclick=\"window.open(this.href, 'tistoryThisBlogPopup', 'width=550, height=510, toolbar=no, menubar=no, status=no, scrollbars=no'); return false;\"><br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\uc2e0\uace0\" src=\"https:\/\/i0.wp.com\/t1.daumcdn.net\/tistory_admin\/static\/ico\/ico_spam_report.png\" style=\"border:0\"\/><br \/>\n<\/a>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\uce5c\uad6c\uc758 \ubd80\ud0c1\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \uc92c\ub2e4. \ubb50&#8230;\uc774\ub7f0\uac70 \ud558\uba74 \uc548\ub418\ub294 \uac70\uaca0\uc9c0\ub9cc -_-; #include \/\/ scanf\uc640 printf\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \ud3ec\ud568\ub428 #include \/\/ strcpy\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \ud3ec\ud568\ub428 #include \/\/ exit\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud558\uc5ec \ud3ec\ud568\ub428 int scissor(int); \/\/ \ucef4\ud4e8\ud130\uc758 \ud544\uc2b9 \uc804\ub7b5 \ud568\uc218 int printing_choice(int , int ); \/\/ \ub204\uac00 \ubb34\uc5c7\uc744 \uace8\ub790\ub294\uc9c0 \uc54c\ub824\uc8fc\ub294 \ud568\uc218 void winner(int ,int ); \/\/ \uc2b9\uc790\uac00 \ub204\uad6c\uc778\uc9c0 \ud310\uc815\ud558\ub294 \ud568\uc218 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-8191","post","type-post","status-publish","format-standard","hentry","category-12"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-287","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/8191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8191"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/8191\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8191"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}