{"id":31,"date":"2020-03-21T23:14:52","date_gmt":"2020-03-21T15:14:52","guid":{"rendered":"http:\/\/47.103.223.234:100\/?p=31"},"modified":"2020-04-15T21:52:55","modified_gmt":"2020-04-15T13:52:55","slug":"%e5%bf%ab%e8%af%bb","status":"publish","type":"post","link":"http:\/\/www.zyhcoding.club\/index.php\/2020\/03\/21\/%e5%bf%ab%e8%af%bb\/","title":{"rendered":"\u624b\u52a8\u4f18\u5316"},"content":{"rendered":"<h4>\u5feb\u901f\u8bfb\u5165read()<\/h4>\n<p>\u5f53\u8bfb\u5165\u6570\u636e\u6bd4\u8f83\u5927\u65f6\uff0c\u8bfb\u5165\u4f18\u5316\u7684\u6548\u679c\u662f\u5f88\u660e\u663e\u7684\u3002\u4e00\u822c\u5f53\u6570\u636e\u8f83\u5927\u65f6\uff0ccin\u81ea\u7136\u5c31\u4e0d\u7528\uff0c\u6539\u7528scanf\uff0c\u4f46\u5f53\u6570\u636e\u66f4\u5927\u65f6\uff0c\u5efa\u8bae\u7528\u5feb\u8bfb\u3002<\/p>\n<pre><code class=\"language-c++\">void read(int &amp;x){        \/\/\u8fd9\u91ccx\u662f\u6574\u6570\uff0cint,ll\u90fd\u53ef\n    int f=1;x=0;char s = getchar();  \/\/f\u8868\u793a\u7b26\u53f7\n    while(s&lt;&#039;0&#039; || s&gt;&#039;9&#039;){if (s==&#039;-&#039;)f = -1;s = getchar();}\n    while(s&gt;=&#039;0&#039; &amp;&amp; s&lt;=&#039;9&#039;){x = x*10+s-&#039;0&#039;;s=getchar();}\n    x *= f;\n}<\/code><\/pre>\n<p>\u5176\u5b9e\u3002\u3002\u8bf4\u771f\u7684\uff0c\u4e4d\u4e00\u773c\u770b\u8fc7\u53bb\uff0c\u6211\u771f\u4e0d\u89c9\u5f97\u5feb\uff0c\u8bfb\u4e00\u4e2a\u6570\u90fd\u8981\u5224\u65ad\u4e0d\u77e5\u9053\u591a\u5c11\u6b21\uff0c\u5224\u65ad\u662f\u5f88\u8d39\u65f6\u7684\u554a\uff0c\u867d\u7136getchar\u662f\u5feb\u3002\u4f46\u7528\u8fd9\u4e2a\u5c31\u662f\u633a\u5feb\u3002<\/p>\n<h4>cin\u4f18\u5316<\/h4>\n<p>\u52a0\u4e0a\u8fd9\u4e2a\uff0c\u548cscanf\u4e00\u6837\u5feb\u4e86\u3002\u8fd9\u662f\u53d6\u6d88cin\u548cscanf\u540c\u6b65\u7684\u4f5c\u7528\u3002<\/p>\n<pre><code class=\"language-c++\">std::ios::sync_with_stdio(false);<\/code><\/pre>\n<h4>\u624b\u52a8\u5438\u6c27<\/h4>\n<p>O2\u4f18\u5316\u80fd\u4f7f\u7a0b\u5e8f\u7684\u7f16\u8bd1\u6548\u7387\u5927\u5927\u63d0\u5347<\/p>\n<pre><code class=\"language-c++\">#pragma GCC optimize(2)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5feb\u901f\u8bfb\u5165read() \u5f53\u8bfb\u5165\u6570\u636e\u6bd4\u8f83\u5927\u65f6\uff0c\u8bfb\u5165\u4f18\u5316\u7684\u6548\u679c\u662f\u5f88\u660e\u663e\u7684\u3002\u4e00\u822c\u5f53\u6570\u636e\u8f83\u5927\u65f6\uff0ccin\u81ea\u7136\u5c31\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/31"}],"collection":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":4,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":284,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/31\/revisions\/284"}],"wp:attachment":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}