{"id":76,"date":"2026-03-23T02:14:58","date_gmt":"2026-03-22T18:14:58","guid":{"rendered":"https:\/\/fc4eye.top\/?p=76"},"modified":"2026-03-24T10:51:23","modified_gmt":"2026-03-24T02:51:23","slug":"c%e8%af%ad%e8%a8%80%e7%bb%8f%e5%85%b8%e7%ae%97%e6%b3%95%e9%97%ae%e9%a2%98-%e7%ba%a6%e7%91%9f%e5%a4%ab%e7%8e%af-%e7%9a%84%e4%b8%aa%e4%ba%ba%e7%90%86%e8%a7%a3%e4%b8%8e%e5%88%86","status":"publish","type":"post","link":"https:\/\/fc4eye.top\/index.php\/2026\/03\/23\/c%e8%af%ad%e8%a8%80%e7%bb%8f%e5%85%b8%e7%ae%97%e6%b3%95%e9%97%ae%e9%a2%98-%e7%ba%a6%e7%91%9f%e5%a4%ab%e7%8e%af-%e7%9a%84%e4%b8%aa%e4%ba%ba%e7%90%86%e8%a7%a3%e4%b8%8e%e5%88%86\/","title":{"rendered":"C\u8bed\u8a00\u7ecf\u5178\u7b97\u6cd5\u95ee\u9898  \u201c\u7ea6\u745f\u592b\u73af\u201d  \u7684\u4e2a\u4eba\u7406\u89e3\u4e0e\u5206\u4eab"},"content":{"rendered":"\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69e8b192ce114&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69e8b192ce114\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"635\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/fc4eye.top\/wp-content\/uploads\/2026\/03\/1774200842-20191221000444_bugts-1024x635.jpg\" alt=\"\" class=\"wp-image-77\" srcset=\"https:\/\/fc4eye.top\/wp-content\/uploads\/2026\/03\/1774200842-20191221000444_bugts-1024x635.jpg 1024w, https:\/\/fc4eye.top\/wp-content\/uploads\/2026\/03\/1774200842-20191221000444_bugts-300x186.jpg 300w, https:\/\/fc4eye.top\/wp-content\/uploads\/2026\/03\/1774200842-20191221000444_bugts-768x476.jpg 768w, https:\/\/fc4eye.top\/wp-content\/uploads\/2026\/03\/1774200842-20191221000444_bugts.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"\u653e\u5927\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>\u8fd9\u7bc7\u6587\u7ae0\uff0c\u662f\u7528\u6765\u5206\u4eab\u6211\u81ea\u5df1\u5bf9c\u8bed\u8a00\u4e00\u4e9b\u7ecf\u5178\u7684\u4e60\u9898\u7684\u7406\u89e3\uff0c\u4e0e\u89e3\u51b3\u65b9\u6cd5 <s>\u5176\u5b9e\u662f\u4f5c\u4e3a\u7ec3\u4e60\u7b14\u8bb0<\/s> \u800c\u5199\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n\n\n\n<p><strong>\u7ea6\u745f\u592b\u73af\u95ee\u9898<\/strong><\/p>\n\n\n\n<p>n\u4e2a\u4eba\u56f4\u6210\u4e00\u5708\uff0c\u4ece\u7b2c\u4e00\u4e2a\u4eba\u5f00\u59cb\u62a5\u6570,\u6570\u5230 m\u7684\u4eba\u51fa\u5217\uff0c\u518d\u7531\u4e0b\u4e00\u4e2a\u4eba\u91cd\u65b0\u4ece1\u5f00\u59cb\u62a5\u6570\uff0c\u6570\u5230 m\u7684\u4eba\u518d\u51fa\u5708\uff0c\u4f9d\u6b21\u7c7b&nbsp;\u63a8\uff0c\u76f4\u5230\u6240\u6709\u7684\u4eba\u90fd\u51fa\u5708\uff0c\u8bf7\u8f93\u51fa\u4f9d\u6b21\u51fa\u5708\u4eba\u7684\u7f16\u53f7\u3002<\/p>\n\n\n\n<p>\u8fd9\u9053\u9898\u7684\u89e3\u51b3\u601d\u8def\uff0c\u4e3b\u8981\u662f\u901a\u8fc7\u5927\u5c0f\u4e3an\u7684\u6570\u7ec4\u6765\u8868\u793an\u4e2a\u4eba\uff0c\u5e76\u901a\u8fc7\u7ed9\u6bcf\u4e2a\u6570\u7ec4\u5143\u7d20\u6765\u8d4b\u503c0\u548c1\uff0c\u6765\u8868\u793a\u6dd8\u6c70\u548c\u5b58\u6d3b\u7684\u4eba\u5458\u7f16\u53f7\uff08\u82e5\u4e3a1\u5219\u6dd8\u6c70\uff0c\u4e3a0\u5219\u5b58\u6d3b\uff09\uff0c\u518d\u5efa\u7acb\u4e00\u4e2a\u5143\u7d20\uff08\u5982 j\uff09\u6765\u8868\u793a\u5f53\u524d\u6dd8\u6c70\u7684\u4eba\u6570\uff0c\u540e\u5efa\u7acb\u5faa\u73af\uff0c\u76f4\u5230\u4ec5\u5269\u4e00\u4eba\u5b58\u6d3b\u540e\u8df3\u51fa<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u5efa\u7acb\u4e00\u4e9b\u5143\u7d20\u548c\u6570\u7ec4\uff0c\u7528\u6765\u8868\u793a\u4eba\u5458\u603b\u6570\uff0c\u4e00\u6b21\u8df3\u8fc7\u7684\u4eba\u6570\uff0c\u4e0e\u6dd8\u6c70\u4eba\u6570\u7684\u8bb0\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int a, b, i = 0, count = 1, j = 0; \/\/count\u7528\u6765\u62a5\u6570\nscanf(\"%d %d\", &amp;a, &amp;b); \/\/a\u4ee3\u8868\u6240\u6709\u7684\u4eba\u6570\uff0cb\u4ee3\u8868\u4e00\u6b21\u8df3\u8fc7\u7684\u4eba\u6570\nint s&#91;a];<\/code><\/pre>\n\n\n\n<p>\u4e4b\u540e\uff0c\u4f7f\u7528for\u5faa\u73af\uff0c\u5c06\u6240\u6709\u6570\u7ec4\u8d4b\u503c\u4e3a0\uff08\u5b58\u6d3b\u72b6\u6001\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (i = 0; i &lt; a; i++) {\n\ts&#91;a] = 0;\n}\ni = 0; \/\/\u5faa\u73af\u7ed3\u675f\u540e\u5c06i\u91cd\u65b0\u8d4b\u503c\u4e3a0 \uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u4f7f\u7528<\/code><\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528while\u5faa\u73af\u548cif-else\u8bed\u53e5\u6765\u8fdb\u884c\u5bf9\u4eba\u5458\u7684\u5faa\u73af\u6dd8\u6c70<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while (1) {\n\tif (j == a - 1)\n\t\tbreak; \/\/\u5f53\u53ea\u5269\u4e0b\u4e00\u4e2a\u4eba\u65f6\uff0c\u8df3\u51fa\u5faa\u73af\n\tif (s&#91;i] == 1)\n\t\ti++; \/\/\u5982\u679c\u8be5\u4eba\u4e3a\u6dd8\u6c70\u7684\u72b6\u6001\uff0c\u5219\u8df3\u8fc7\u8be5\u4eba\n\telse {\n\t\tif (count == b) { \/\/\u6ee1\u8db3\u88ab\u6dd8\u6c70\u7684\u6761\u4ef6\n\t\t\ts&#91;i] = 1; \/\/\u8bbe\u7f6e\u6dd8\u6c70\u6761\u4ef6\n\t\t\tj++; \/\/\u6dd8\u6c70\u4eba\u6570\u52a0\u4e00\n\t\t\tprintf(\"%d \", i);\n\t\t\tcount = 1; \/\/\u91cd\u7f6e\n\t\t\ti++; \/\/\u79fb\u52a8\u81f3\u4e0b\u4e00\u4e2a\u4eba\n\t\t}\n\t\telse { \/\/\u4e0d\u6ee1\u8db3\u88ab\u6dd8\u6c70\u7684\u72b6\u6001\n\t\t\tcount++;\n\t\t\ti++;\n\t\t}\n\t}\n\tif (i == a) \/\/\u7531\u4e8e\u6570\u7ec4\u4e0b\u6807\u4ece0\u5f00\u59cb\uff0c\u6240\u4ee5\u5f53i=n\u65f6\uff0c\u5c31\u662f\u79fb\u52a8\u5230\u7b2c\u4e00\u4e2a\u4eba\u4e86\n\t\ti = 0;\n}<\/code><\/pre>\n\n\n\n<p>\u6700\u540e\uff0c\u4f7f\u7528for\u5faa\u73af\uff0c\u8f93\u51fa\u5b58\u6d3b\u7684\u4eba\u7684\u4ee3\u53f7\uff0c\u67e5\u8be2\u5230\u540ebreak\u8df3\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (i = 0;; i++) {\n\tif (s&#91;i] == 0) {\n\t\tprintf(\"%d\", i);\n\t\tbreak;\n\t}\n}<\/code><\/pre>\n\n\n\n<p>\u6700\u7ec8\u7b54\u6848\u4e3a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include <stdio.h>\nint main(void) {\n\tint a, b, i = 0, count = 1, j = 0;\n\tscanf(\"%d %d\", &amp;a, &amp;b);\/\/a\u4ee3\u8868\u6240\u6709\u7684\u4eba\u6570\uff0cb\u4ee3\u8868\u4e00\u6b21\u8df3\u8fc7\u7684\u4eba\u6570\n\tint s&#91;a];\n\tfor (i = 0; i &lt; a; i++) {\n\t\ts&#91;a] = 0;\n\t}\n\ti = 0;\/\/\u5c06i\u91cd\u65b0\u8d4b\u503c\u4e3a0 \uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u4f7f\u7528\n\twhile (1) {\n\t\tif (j == a - 1)\n\t\t\tbreak;\n\t\tif (s&#91;i] == 1)\n\t\t\ti++;\n\t\telse {\n\t\t\tif (count == b) {\n\t\t\t\ts&#91;i] = 1;\n\t\t\t\tj++;\n\t\t\t\tprintf(\"%d \", i);\n\t\t\t\tcount = 1;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcount++;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tif (i == a)\n\t\t\ti = 0;\n\t}\n\tprintf(\"\\n\u5b58\u6d3b\u5e8f\u53f7\");\n\tfor (i = 0;; i++) {\n\t\tif (s&#91;i] == 0) {\n\t\t\tprintf(\"%d\", i);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn 0;\n}<\/stdio.h><\/code><\/pre>\n\n\n\n<p>\u6ce8\uff1a\u5728vs\u4e2d\uff0c\u8fd9\u4e32\u7b54\u6848\u91cc\u7684printf\u6240\u8f93\u51fa\u7684\u6587\u5b57\uff0c\u5728\u7f16\u8bd1\u5668\u4e0a\u4f1a\u4ee5\u4e71\u7801\u5f62\u5f0f\u51fa\u73b0\uff0c\u5c1a\u4e0d\u6e05\u695a\u539f\u56e0\uff0c\u4e0d\u8fc7\u7b54\u6848\u6ca1\u6709\u4efb\u4f55\u5dee\u9519<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\uff0c\u662f\u7528\u6765\u5206\u4eab\u6211\u81ea\u5df1\u5bf9c\u8bed\u8a00\u4e00\u4e9b\u7ecf\u5178\u7684\u4e60\u9898\u7684\u7406\u89e3\uff0c\u4e0e\u89e3\u51b3\u65b9\u6cd5 \u5176\u5b9e\u662f\u4f5c\u4e3a\u7ec3\u4e60\u7b14\u8bb0 \u800c\u5199\uff0c\u4ec5\u4f9b\u53c2\u8003 \u7ea6\u745f\u592b\u73af\u95ee\u9898 n\u4e2a\u4eba\u56f4\u6210\u4e00 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":77,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":9,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":88,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/posts\/76\/revisions\/88"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/media\/77"}],"wp:attachment":[{"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fc4eye.top\/index.php\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}