{"id":167,"date":"2025-02-02T08:23:34","date_gmt":"2025-02-02T08:23:34","guid":{"rendered":"http:\/\/west.wangyuansheng.cn\/?p=167"},"modified":"2025-07-18T06:07:43","modified_gmt":"2025-07-18T06:07:43","slug":"%e7%a9%ba%e5%bf%83%e6%ad%a3%e6%96%b9%e5%bd%a2","status":"publish","type":"post","link":"http:\/\/west.wangyuansheng.cn\/?p=167","title":{"rendered":"\u7a7a\u5fc3\u6b63\u65b9\u5f62"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u5206\u6790\u95ee\u9898<\/h1>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u6253\u5370\u4e00\u4e2a\u7a7a\u5fc3\u6b63\u65b9\u5f62<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u5c06\u95ee\u9898\u5206\u4e3a\u4e09\u6b65<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1 \u5229\u7528\u5d4c\u5957\u5faa\u73af\u6253\u5370\u5b9e\u5fc3\u7684\u6b63\u65b9\u5f62<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2 \u589e\u52a0\u6761\u4ef6\u5224\u65ad\uff1a\u5982\u679c\u662f\u7b2c\u4e00\u884c\u6216\u6700\u540e\u4e00\u884c\uff0c\u5b8c\u5168\u8f93\u51fa<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3 \u589e\u52a0\u6761\u4ef6\u5224\u65ad\uff1a\u4e0d\u662f\u7684\u9996\u5c3e\u884c\uff0c\u53ea\u4fdd\u7559\u7b2c1\u5217\u548c\u6700\u540e1\u5217\u7684\u661f\u53f7<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u5efa\u7acb\u6a21\u578b<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<ol class=\"wp-block-list\">\n<li><strong>\u83b7\u53d6\u7528\u6237\u8f93\u5165\u503c<\/strong>\uff1a\u4f8b\u5982\u7528\u6237\u8f93\u5165\u6570\u503c<code>n<\/code>\uff0c\u76ee\u6807\u5219\u4e3a\u4e94\u884c\u4e94\u5217\u7684\u6b63\u65b9\u5f62<\/li>\n\n\n\n<li><strong>\u5916\u5c42\u5faa\u73af\u63a7\u5236\u884c\u6570<\/strong>\uff1a\u4f7f\u7528\u4e00\u4e2a\u5916\u5c42\u5faa\u73af\u53d8\u91cf\uff08\u8bbe\u4e3a <code>i<\/code>\uff09\u6765\u63a7\u5236\u6253\u5370\u7684<strong>\u884c\u6570<\/strong>\uff0c\u5faa\u73af\u6b21\u6570\u4e3a\u8f93\u5165\u7684 <code>n<\/code>\u3002<\/li>\n\n\n\n<li><strong>\u7b2c\u4e00\u884c\u548c\u6700\u540e\u4e00\u884c\u6253\u5370\u89c4\u5219<\/strong>\uff1a\u5f53 <code>i<\/code> \u7b49\u4e8e 1\uff08\u7b2c\u4e00\u884c\uff09\u6216\u8005 <code>i<\/code> \u7b49\u4e8e <code>n<\/code>\uff08\u6700\u540e\u4e00\u884c\uff09\u65f6\uff0c\u8ba9\u6bcf\u884c\u6253\u5370 <code>n<\/code> \u4e2a\u7528\u4e8e\u6784\u6210\u6b63\u65b9\u5f62\u7684\u5b57\u7b26\uff08\u6bd4\u5982 <code>*<\/code>\uff09\u3002<\/li>\n\n\n\n<li><strong>\u4e2d\u95f4\u884c\u6253\u5370\u89c4\u5219<\/strong>\uff1a\u5f53 <code>i<\/code> \u65e2\u4e0d\u7b49\u4e8e 1 \u4e5f\u4e0d\u7b49\u4e8e <code>n<\/code>\uff08\u5373\u4e2d\u95f4\u884c\uff09\u65f6\uff0c\u5982\u679c<code>j<\/code>\u7b49\u4e8e1\u6216\u8005<code>j<\/code>\u7b49\u4e8e<code>n<\/code>,\u5219\u5c06\u6253\u5370\u7a7a\u683c\u3002<\/li>\n\n\n\n<li><strong>\u6574\u4f53\u6d41\u7a0b<\/strong>\uff1a\u901a\u8fc7\u5916\u5c42\u5faa\u73af\u7684\u6bcf\u6b21\u8fed\u4ee3\uff0c\u4f9d\u636e\u4e0a\u8ff0\u89c4\u5219\u6253\u5370\u51fa\u5bf9\u5e94\u884c\uff0c\u76f4\u81f3\u5b8c\u6210 <code>n<\/code> \u884c\u7684\u6253\u5370\uff0c\u5f97\u5230 <code>n<\/code> \u884c\u7684\u7a7a\u5fc3\u6b63\u65b9\u5f62\u3002<\/li>\n<\/ol>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\u7f16\u5199\u4ee3\u7801<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;bits\/stdc++.h&gt;\nusing namespace std;\nint main(){\n    int n;\n    cin&gt;&gt;n;\n    for(int i=1;i&lt;=n;i++){\n        for(int j=1;j&lt;=n;j++){\n            if(i==1 || i==n){\n                cout&lt;&lt;\"*\";\n            }else{\n                if(j==1 || j==n){\n                    cout&lt;&lt;\"*\";\n                }else{\n                    cout&lt;&lt;\" \";\n                }\n            }\n        }\n        cout&lt;&lt;\"\\n\";\n    }\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4fdd\u5b58 \u7f16\u8bd1 \u8fd0\u884c<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u6790\u95ee\u9898 \u6253\u5370\u4e00\u4e2a\u7a7a\u5fc3\u6b63\u65b9\u5f62 \u53ef\u4ee5\u5c06\u95ee\u9898\u5206\u4e3a\u4e09\u6b65&#8230; <a class=\"read-more\" href=\"http:\/\/west.wangyuansheng.cn\/?p=167\">\u9605\u8bfb\u66f4\u591a&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-167","post","type-post","status-publish","format-standard","hentry","category-problem"],"_links":{"self":[{"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167"}],"version-history":[{"count":2,"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":376,"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=\/wp\/v2\/posts\/167\/revisions\/376"}],"wp:attachment":[{"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/west.wangyuansheng.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}