{"id":411,"date":"2022-10-06T20:57:17","date_gmt":"2022-10-06T12:57:17","guid":{"rendered":"https:\/\/blog.cirno.fun\/?p=411"},"modified":"2024-09-12T09:30:41","modified_gmt":"2024-09-12T01:30:41","slug":"%e5%bf%ab%e8%af%bb%e4%bc%98%e5%8c%96%e6%a8%a1%e6%9d%bf","status":"publish","type":"post","link":"https:\/\/blog.sssn.tech\/?p=411","title":{"rendered":"\u5feb\u8bfb\u4f18\u5316\u6a21\u677f"},"content":{"rendered":"<p>\u56e0\u4e3a\u6d41\u662f\u4e00\u79cd\u6709\u5ef6\u65f6\u7684\u5904\u7406\u529e\u6cd5\uff0c\u8bfb\u5165\u548c\u5f85\u8f93\u51fa\u7684\u6570\u636e\u4f1a\u5148\u88ab\u50a8\u5b58\u5728\u5185\u5b58\u91cc\uff0c\u8fd9\u6837\u4f1a\u4f7f\u5f97\u5728\u5927\u89c4\u6a21\u6570\u636e\u7684\u9898\u4e2d\u8fd9\u79cd\u8f93\u5165\u8f93\u51fa\u65b9\u5f0f\u6709\u4e9b\u8d39\u65f6\u95f4<\/p>\n<p>\u8bfb\u5165\u4f18\u5316\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-cpp\">int read() {\n    int X=0,w=1;\/\/w\u7528\u6765\u63a7\u5236\u6b63\u8d1f\u6570\n    char c=getchar();\/\/\u8fd9\u91cc\u5148\u8bfb\u4e00\u4e2a\u5b57\u7b26\n    while(c&lt;&#039;0&#039;||c&gt;&#039;9&#039;){\/\/\u8df3\u8fc7\u6240\u6709\u4e0d\u4e3a\u6570\u5b57\u7684\u5b57\u7b26\n        if (c==&#039;-&#039;) w=-1;\/\/\u5982\u679c\u8bfb\u5230\u8d1f\u53f7\uff0cw\u6539\u53d8\n        c=getchar();\n    }\n    while(c&gt;=&#039;0&#039;&amp;&amp;c&lt;=&#039;9&#039;)\n        \/*\n        \u8fd9\u91cc\u662fx=x*10+c-&#039;0&#039;\n        x*10=x*2+x*8\uff0c\u7528\u4f4d\u8fd0\u7b97\u518d\u6b21\u4f18\u5316\u6548\u7387\n        *\/\n        X=(X&lt;&lt;3)+(X&lt;&lt;1)+c-&#039;0&#039;,\n        c=getchar();\n    return X*w;\n}<\/code><\/pre>\n<p>\u7f29\u884c\uff1a<\/p>\n<pre><code class=\"language-cpp\">int read(){\n    int X=0,w=1;char c=getchar();\n    while(c&lt;&#039;0&#039;||c&gt;&#039;9&#039;)\n        {if (c==&#039;-&#039;) w=-1;c=getchar();}\n    while(c&gt;=&#039;0&#039;&amp;&amp;c&lt;=&#039;9&#039;)X=(X&lt;&lt;3)+(X&lt;&lt;1)+c-&#039;0&#039;,c=getchar();\n    return X*w;\n}\n<\/code><\/pre>\n<p>\u6700\u7ec8\u7248<\/p>\n<pre><code class=\"language-cpp\">int read(){\n    int x=0,k=1;char ch=getchar();\n    while(ch&lt;&#039;0&#039; || ch&gt;&#039;9&#039;){\n        if(ch==&#039;-&#039;)k=-1;\n        ch=getchar();\n    }\n    while(ch&gt;=&#039;0&#039; &amp;&amp; ch&lt;=&#039;9&#039;){\n        x=(x&lt;&lt;3)+(x&lt;&lt;1)+(ch^&#039;0&#039;);\n        ch=getchar();\n    }\n    return x*k;\n}<\/code><\/pre>\n<p>\u80fd\u7528\u4f4d\u8fd0\u7b97\u5c31\u7528\u4f4d\u8fd0\u7b97\u5427<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3a\u6d41\u662f\u4e00\u79cd\u6709\u5ef6\u65f6\u7684\u5904\u7406\u529e\u6cd5\uff0c\u8bfb\u5165\u548c\u5f85\u8f93\u51fa\u7684\u6570\u636e\u4f1a\u5148\u88ab\u50a8\u5b58\u5728\u5185\u5b58\u91cc\uff0c\u8fd9\u6837\u4f1a\u4f7f\u5f97\u5728 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-411","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts\/411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=411"}],"version-history":[{"count":1,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":735,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts\/411\/revisions\/735"}],"wp:attachment":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}