{"id":1524,"date":"2011-03-21T18:00:00","date_gmt":"2011-03-21T10:00:00","guid":{"rendered":""},"modified":"2013-11-23T15:03:07","modified_gmt":"2013-11-23T07:03:07","slug":"%e7%81%ab%e6%9f%b4%e6%a3%8d%e5%bc%8f%e7%a8%8b%e5%ba%8f%e5%91%98%e9%9d%a2%e8%af%95%e9%a2%98","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/1524.html","title":{"rendered":"\u201c\u706b\u67f4\u68cd\u5f0f\u201d\u7a0b\u5e8f\u5458\u9762\u8bd5\u9898"},"content":{"rendered":"<p>\u6709\u65f6\u5019\uff0c\u6709\u4e9b\u9762\u8bd5\u9898\u662f\u5f88\u662f\u65e0\u5398\u5934\uff0c\u8fd9\u4e0d\uff0c\u53c8\u6709\u4e00\u4e2a\uff0c\u8fd8\u8bb0\u5f97\u5c0f\u65f6\u5019\u73a9\u7684\u7684\u201c\u706b\u67f4\u68cd\u6e38\u620f\u201d\u5417\uff0c\u5c31\u662f\u79fb\u52a8\u4e00\u6839\u706b\u67f4\u68cd\u6539\u53d8\u4e00\u4e2a\u56fe\u6216\u5b57\u7684\u6e38\u620f\u3002\u7a0b\u5e8f\u9762\u8bd5\u5c45\u7136\u4e5f\u53ef\u4ee5\u8fd9\u4e48\u73a9\uff0c\u770b\u770b\u4e0b\u9762\u8fd9\u4e2a\u706b\u67f4\u68cd\u5f0f\u7684\u7a0b\u5e8f\u9762\u8bd5\u9898\u5427\u3002<\/p>\n<div>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2aC\u7a0b\u5e8f\uff0c\u5176\u60f3\u8981\u8f93\u51fa20\u4e2a\u51cf\u53f7\uff0c\u4e0d\u8fc7\uff0c\u7c97\u5fc3\u7684\u7a0b\u5e8f\u5458\u628a\u4ee3\u7801\u5199\u9519\u4e86\uff0c\u4f60\u9700\u8981\u628a\u4e0b\u9762\u7684\u4ee3\u7801\u4fee\u6539\u6b63\u786e\uff0c\u4e0d\u8fc7\uff0c\u4f60\u53ea\u80fd\u589e\u52a0\u6216\u662f\u4fee\u6539\u5176\u4e2d\u7684\u4e00\u4e2a\u5b57\u7b26\uff0c\u8bf7\u4f60\u7ed9\u51fa\u4e09\u79cd\u7b54\u6848\u3002<\/p>\n<p>int n = 20;<br \/>\nfor(int i = 0; i &lt; n; i&#8211;){<br \/>\nprintf(&#8220;-&#8220;);<br \/>\n}<\/p>\n<p>\u4e0d\u8981\u4ee5\u4e3a\u8fd9\u9898\u4e0d\u662f\u5f88\u96be\uff0c\u6211\u76f8\u4fe1\u4f60\u5e76\u4e0d\u90a3\u4e48\u5bb9\u6613\u80fd\u627e\u52303\u79cd\u65b9\u6cd5\u3002\u6211\u89c9\u5f97\uff0c\u5982\u679c\u4f60\u80fd\u572810\u5206\u949f\u5185\u627e\u51fa\u8fd9\u4e09\u79cd\u65b9\u6cd5\uff0c\u8bf4\u660e\u4f60\u771f\u7684\u5f88\u806a\u660e\uff0c\u800c\u4e14\u53cd\u5e94\u5f88\u5feb\u3002\u5f53\u7136\uff0c15\u5206\u949f\u5185\u4e5f\u4e0d\u8d56\u3002\u4e0d\u8fc7\uff0c\u4f60\u8981\u662f30\u5206\u949f\u5185\u627e\u4e0d\u5230\u4e09\u79cd\u65b9\u6cd5\uff0c\u5f53\u7136\uff0c\u4e0d\u8bf4\u660e\u4f60\u7b28\u4e86\uff0c\u6700\u591a\u5c31\u662f\u4f60\u7684\u53cd\u5e94\u8fd8\u4e0d\u591f\u5feb\u3002\u563f\u563f\u3002\u5c31\u5f53\u662f\u73a9\u73a9\u5427\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u6211\u7684\u7b54\u6848\uff1a<\/p>\n<p>\/\/\u7b2c\u4e00\u79cd\u89e3\u6cd5\uff1a\u5728for\u5faa\u73af\u4e2d\u7ed9n\u52a0\u4e00\u4e2a\u8d1f\u53f7<br \/>\nfor(int i = 0; i &lt; -n; i&#8211;)<\/p>\n<p>\/\/\u7b2c\u4e8c\u79cd\u89e3\u6cd5\uff1a\u628a n \u521d\u59cb\u5316\u6210 -20<br \/>\nint n = -20;<\/p>\n<p>\/\/\u7b2c\u4e09\u79cd\u89e3\u6cd5\uff1a\u628afor\u5faa\u73af\u4e2d\u7684 i \u521d\u59cb\u5316\u621040<br \/>\nfor(int i = 40; i &lt; n; i&#8211;)<br \/>\n\u4e0d\u8fc7\uff0c\u6211\u8981\u544a\u8bc9\u4f60\uff0c\u4ee5\u4e0a\u8fd9\u4e9b\u7b54\u6848\u90fd\u4e0d\u5bf9\uff08\u6211\u5c31\u77e5\u9053\u4f60\u4f1a\u5077\u770b\u7b54\u6848\u7684\uff09\uff0c\u4e0d\u8fc7\uff0c\u987a\u7740\u8fd9\u4e9b\u601d\u8def\u8d70\u5f88\u63a5\u8fd1\u4e86\u3002\u5475\u5475\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u6b63\u786e\u7b54\u6848\u2014\u2014<\/p>\n<p>\/\/\u7b2c\u4e00\u79cd\u89e3\u6cd5\uff1a\u5728for\u5faa\u73af\u4e2d\u7ed9 i \u52a0\u4e00\u4e2a\u8d1f\u53f7<br \/>\nfor(int i = 0; -i &lt; n; i&#8211;)<\/p>\n<p>\/\/\u7b2c\u4e8c\u79cd\u89e3\u6cd5\uff1a\u5728for\u5faa\u73af\u4e2d\u628a i&#8211; \u53d8\u6210 n&#8211;<br \/>\nfor(int i = 0; i &lt; n; n&#8211;)<\/p>\n<p>\/\/\u7b2c\u4e09\u79cd\u89e3\u6cd5\uff1a\u628afor\u5faa\u73af\u4e2d\u7684 &lt; \u53d8\u6210 +<br \/>\nfor(int i = 0; i + n; i&#8211;)<br \/>\n\u5176\u5b83\u76f8\u5173\u7684\u53d8\u79cd\u9898\u5982\u4e0b\uff1a<\/p>\n<p>\u901a\u8fc7\u4fee\u6539\u3001\u589e\u52a0\u4e00\u4e2a\u5b57\u7b26\uff0c\u8ba9\u5176\u8f93\u51fa21\u4e2a\u51cf\u53f7<br \/>\n\u901a\u8fc7\u4fee\u6539\u3001\u589e\u52a0\u4e00\u4e2a\u5b57\u7b26\uff0c\u8ba9\u5176\u53ea\u8f93\u51fa1\u4e2a\u51cf\u53f7<br \/>\n\u901a\u8fc7\u4fee\u6539\u3001\u589e\u52a0\u4e00\u4e2a\u5b57\u7b26\uff0c\u8ba9\u5176\u4e0d\u8f93\u51fa\u51cf\u53f7<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\uff0c\u6709\u4e9b\u9762\u8bd5\u9898\u662f\u5f88\u662f\u65e0\u5398\u5934\uff0c\u8fd9\u4e0d\uff0c\u53c8\u6709\u4e00\u4e2a\uff0c\u8fd8\u8bb0\u5f97\u5c0f\u65f6\u5019\u73a9\u7684\u7684\u201c\u706b\u67f4\u68cd\u6e38\u620f\u201d\u5417\uff0c\u5c31\u662f\u79fb\u52a8\u4e00\u6839\u706b\u67f4\u68cd\u6539\u53d8\u4e00\u4e2a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1524","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=1524"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1524\/revisions"}],"predecessor-version":[{"id":5156,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/1524\/revisions\/5156"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=1524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=1524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=1524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}