{"id":10306,"date":"2012-08-09T02:01:00","date_gmt":"2012-08-09T02:01:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=10306"},"modified":"2012-08-09T02:01:00","modified_gmt":"2012-08-09T02:01:00","slug":"8%ec%9d%80-%eb%aa%87%ea%b0%9c%ec%9d%b8%ea%b0%80","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=10306","title":{"rendered":"8\uc740 \uba87\uac1c\uc778\uac00"},"content":{"rendered":"<div class=\"desc\">\n<div class=\"tt_article_useless_p_margin\">\n<p>\n<a class=\"tx-link\" href=\"http:\/\/news.zum.com\/articles\/2829610\" target=\"_blank\"><br \/>\n           http:\/\/news.zum.com\/articles\/2829610<br \/>\n          <\/a>\n<\/p>\n<p>\n\n<\/p>\n<p>\n          \uad6c\uae00 \uc785\uc0ac \ubb38\uc81c\uc911\uc5d0 1\uc5d0\uc11c 10000\uae4c\uc9c0 8\uc774 \uba87\uac1c \ub098\uc624\ub294\uc9c0 \uc138\ubcf4\ub77c\ub294 \ubb38\uc81c\uac00 \uc788\ub2e4\uace0 \ud55c\ub2e4.\n         <\/p>\n<p>\n\n<\/p>\n<p>\n          \ub098\uc758 \ud574\ubc95.<br \/>\n          \n<\/p>\n<div class=\"txc-textbox\" style=\"border-style: solid; border-width: 1px; border-color: rgb(254, 222, 199); background-color: rgb(254, 222, 199); padding: 10px;\">\n<p>\n           a=0<br \/>\n           <br \/>\n           for i in range(10000):<br \/>\n           <br \/>\n           n=i+1<br \/>\n           <br \/>\n           while(n>0):<br \/>\n           <br \/>\n           a+=int(((n+2)%10)==0)<br \/>\n           <br \/>\n           n\/=10<br \/>\n           <br \/>\n           print(a)\n          <\/p>\n<\/div>\n<p>\n\n<\/p>\n<p>\n          \uba87\uc790 \ub354 \uc904\uc778 \ubc84\uc804.<br \/>\n          \n<\/p>\n<div class=\"txc-textbox\" style=\"border-style: solid; border-width: 1px; border-color: rgb(231, 253, 181); background-color: rgb(231, 253, 181); padding: 10px;\">\n<p>\n           a=0\n          <\/p>\n<p>\n           i=10000<br \/>\n           \n<\/p>\n<p>\n           while(i>0):<br \/>\n           <br \/>\n           while(n>0):<br \/>\n           <br \/>\n           a+=int((n%10)==8)<br \/>\n           <br \/>\n           n\/=10\n          <\/p>\n<p>\n           i-=1<br \/>\n           <br \/>\n           print(a)\n          <\/p>\n<\/div>\n<p>\n\n<\/p>\n<p>\n          \uc99d\uba85.\n         <\/p>\n<p>\n\n<\/p>\n<p>\n          1. (n%10)\uc740 n\uc744 10\uc73c\ub85c \ub098\ub208 \ub098\uba38\uc9c0\uc774\ub2e4.<br \/>\n          \n<\/p>\n<p>\n          2. (n%10)\uc774 8\uc778 \uacbd\uc6b0 (n%10)==8\uc740 True\uc774\ub2e4.\n         <\/p>\n<p>\n          3. (n%10)\uc774 8\uc774 \uc544\ub2cc \uacbd\uc6b0 (n%10)==8\uc740 False\uc774\ub2e4.<br \/>\n          \n<\/p>\n<p>\n          4. Python\uc5d0\uc11c int(True)\ub294 1\uc774\ub2e4.\n         <\/p>\n<p>\n          5. Python\uc5d0\uc11c int(False)\ub294 0\uc774\ub2e4.\n         <\/p>\n<p>\n          6. a+=x\ub294 a\uc5d0 a+x\ub97c \ub300\uc751\uc2dc\ud0a8\ub2e4.\n         <\/p>\n<p>\n          7. 1~6\uc5d0 \uc758\ud574, a+=int((n%10)==8)\uc774 \uc2e4\ud589\ub418\uba74, n\uc758 1\uc758 \uc790\ub9ac\uc5d0 \uc788\ub294 \uc218\uac00 8\uc774\uba74 a\ub294 1\ub9cc\ud07c \ucee4\uc9c0\uace0, 8\uc774 \uc544\ub2c8\uba74 \ubcc0\ud558\uc9c0 \uc54a\ub294\ub2e4.\n         <\/p>\n<p>\n          8. n\/=10\uc740 n\uc5d0 n\uc74410\uc73c\ub85c \ub098\ub208 \ubaab\uc744 \ub300\uc751\uc2dc\ud0a8\ub2e4. \uc774\ub54c, n\uacfc 10\uc774 \ubaa8\ub450 int\ud615\uc774\uba74 \ub098\uba38\uc9c0\ub294 \ubc84\ub824\uc9c4\ub2e4.\n         <\/p>\n<p>\n          9. while(n>0)\uc740 n\uc774 0\ubcf4\ub2e4 \ucee4\uc57c \uc218\ud589\ub418\uace0 0\uc774\uac70\ub098 0\ubcf4\ub2e4 \uc791\uc73c\uba74 \uc218\ud589\ub418\uc9c0 \uc54a\ub294\ub2e4.\n         <\/p>\n<p>\n          10. \uac00\uc7a5 \ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc218\ud589\ub418\ub294 \uacbd\uc6b0\ub294 n\uc774 \ud55c\uc790\ub9ac \uc218\uc774\uace0, \uc774\ud6c4\uc5d0 n\/=10\uc744 \uc218\ud589\ud558\uba74 n=0\uc774 \ub418\uc5b4 \uc788\ub2e4.<br \/>\n          \n<\/p>\n<p>\n          11. \ub530\ub77c\uc11c while(n>0)\uad6c\ubb38\uc774 \uc218\ud589\ub418\uace0 \ub098\uba74 a\ub294 n\uc5d0 \uc788\ub294 8\uc758 \uc218\ub9cc\ud07c \uc99d\uac00\ud55c\ub2e4.\n         <\/p>\n<p>\n          12. \ub530\ub77c\uc11c while(i>0)\uad6c\ubb38\uc774 \uc218\ud589\ub418\uba74 1\ubd80\ud130 10000\uc0ac\uc774\uc5d0 \uc788\ub294 \uac01 \uc815\uc218\ub4e4\uc774 \uac00\uc9c0\uace0 \uc788\ub294 8\uc758 \uc218\ub97c \uc140 \uc218 \uc788\ub2e4.\n         <\/p>\n<p>\n\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=3143\" 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<\/div>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/news.zum.com\/articles\/2829610 \uad6c\uae00 \uc785\uc0ac \ubb38\uc81c\uc911\uc5d0 1\uc5d0\uc11c 10000\uae4c\uc9c0 8\uc774 \uba87\uac1c \ub098\uc624\ub294\uc9c0 \uc138\ubcf4\ub77c\ub294 \ubb38\uc81c\uac00 \uc788\ub2e4\uace0 \ud55c\ub2e4. \ub098\uc758 \ud574\ubc95. a=0 for i in range(10000): n=i+1 while(n>0): a+=int(((n+2)%10)==0) n\/=10 print(a) \uba87\uc790 \ub354 \uc904\uc778 \ubc84\uc804. a=0 i=10000 while(i>0): while(n>0): a+=int((n%10)==8) n\/=10 i-=1 print(a) \uc99d\uba85. 1. (n%10)\uc740 n\uc744 10\uc73c\ub85c \ub098\ub208 \ub098\uba38\uc9c0\uc774\ub2e4. 2. (n%10)\uc774 8\uc778 \uacbd\uc6b0 (n%10)==8\uc740 True\uc774\ub2e4. 3. (n%10)\uc774 8\uc774 \uc544\ub2cc \uacbd\uc6b0 [&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":[2],"tags":[],"class_list":["post-10306","post","type-post","status-publish","format-standard","hentry","category-academic"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-2Ge","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/10306","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=10306"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/10306\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10306"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}