{"id":226,"date":"2017-03-13T15:05:42","date_gmt":"2017-03-13T14:05:42","guid":{"rendered":"http:\/\/www.tastestars.com\/?p=226"},"modified":"2017-03-14T03:34:07","modified_gmt":"2017-03-14T02:34:07","slug":"jobdu1138","status":"publish","type":"post","link":"https:\/\/tastestars.com\/index.php\/2017\/03\/13\/jobdu1138\/","title":{"rendered":"\u4e5d\u5ea6\u9898\u76ee1138\uff1a\u8fdb\u5236\u8f6c\u6362"},"content":{"rendered":"\n<li>\u9898\u76ee\u63cf\u8ff0\uff1a<\/li>\n<p>\u5c06\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u4e3a30\u4f4d\u6570\u5b57\u7684\u5341\u8fdb\u5236\u975e\u8d1f\u6574\u6570\u8f6c\u6362\u4e3a\u4e8c\u8fdb\u5236\u6570\u8f93\u51fa\u3002<\/p>\n<li>\u8f93\u5165\uff1a<\/li>\n<p>\u591a\u7ec4\u6570\u636e\uff0c\u6bcf\u884c\u4e3a\u4e00\u4e2a\u957f\u5ea6\u4e0d\u8d85\u8fc730\u4f4d\u7684\u5341\u8fdb\u5236\u975e\u8d1f\u6574\u6570\u3002<br \/>\n\uff08\u6ce8\u610f\u662f10\u8fdb\u5236\u6570\u5b57\u7684\u4e2a\u6570\u53ef\u80fd\u670930\u4e2a\uff0c\u800c\u975e30bits\u7684\u6574\u6570\uff09<\/p>\n<li>\u8f93\u51fa\uff1a<\/li>\n<p>\u6bcf\u884c\u8f93\u51fa\u5bf9\u5e94\u7684\u4e8c\u8fdb\u5236\u6570\u3002<\/p>\n<li>\u601d\u8def\uff1a<\/li>\n<p>\u5927\u6574\u6570\uff0clonglong\u5b58\u4e0d\u4e0b\uff0c\u7528\u6570\u7ec4\uff0c\u6a21\u4eff\u624b\u5199\u9664\u6cd5\u7684\u601d\u60f3\u3002<\/p>\n<li>\u4ee3\u7801\uff1a<\/li>\n<pre class=\"lang:default decode:true \" >#include&lt;iostream&gt;\r\n#include&lt;cstdio&gt;\r\n#include&lt;math.h&gt;\r\n#include&lt;string.h&gt;\r\nusing namespace std;\r\nint main(){\r\n    int x,y;\r\n    char n[100];\r\n    char ans[100];\r\n    while(cin&gt;&gt;n){\r\n        int j=0,i;\r\n        int sum=1;\r\n        while(sum){\r\n            sum=0;\r\n            int len=strlen(n);\r\n            for(i=0;i&lt;len;i++){          \r\n                x=(n[i]-'0')%2; \/\/\u4f59\u6570\r\n                y=(n[i]-'0')\/2; \/\/\u5546\r\n            \/\/  cout&lt;&lt;\"x=\"&lt;&lt;x&lt;&lt;\" y=\"&lt;&lt;y&lt;&lt;endl;\r\n                sum=sum+y;  \/\/\u5c06\u5546\u6bcf\u4e00\u4f4d\u90fd\u52a0\u8d77\u6765\uff0c\u770b\u770b\u662f\u5426\u4e3a0\r\n            \/\/  cout&lt;&lt;\"sum=\"&lt;&lt;sum&lt;&lt;endl;\r\n                if(i==len-1){\r\n                    ans[j++]=x+'0';  \/\/\u5f97\u5230\u4e00\u4e2a\u6700\u7ec8\u7684\u4f59\u6570\r\n            \/\/      cout&lt;&lt;\"ans=\"&lt;&lt;ans[j-1]&lt;&lt;\" \"&lt;&lt;ans[j]&lt;&lt;\" \"&lt;&lt;x&lt;&lt;endl;\r\n                }\r\n                else{\r\n                    n[i+1]=n[i+1]+x*10;\/\/\u628a\u5b83\u5f53\u6210\u662f\u6570\u5b57\u6765\u770b\u4e86\r\n                }\r\n                n[i]=y+'0';\r\n        \/\/      cout&lt;&lt;\"n[i]=\"&lt;&lt;n[i]&lt;&lt;endl;\r\n            }\r\n        }\r\n        for(i=j-1;i&gt;=0;i--){\r\n            cout&lt;&lt;ans[i];\r\n        }\r\n        cout&lt;&lt;endl;\r\n    }\r\n    return 0;\r\n}\r\n\/**************************************************************\r\n    Problem: 1138\r\n    User: WZDCJ0206\r\n    Language: C++\r\n    Result: Accepted\r\n    Time:230 ms\r\n    Memory:1520 kb\r\n****************************************************************\/<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u63cf\u8ff0\uff1a \u5c06\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u4e3a30\u4f4d\u6570\u5b57\u7684\u5341\u8fdb\u5236\u975e\u8d1f\u6574\u6570\u8f6c\u6362\u4e3a\u4e8c\u8fdb\u5236\u6570\u8f93\u51fa\u3002 \u8f93\u5165\uff1a \u591a\u7ec4\u6570\u636e\uff0c\u6bcf\u884c\u4e3a\u4e00\u4e2a\u957f\u5ea6\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[32,3],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-c","category-studynote"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9Hs6X-3E","_links":{"self":[{"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":6,"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/posts\/226\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tastestars.com\/index.php\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}