{"id":354,"date":"2022-09-15T20:05:48","date_gmt":"2022-09-15T12:05:48","guid":{"rendered":"https:\/\/qaqaq.top\/?p=354"},"modified":"2022-11-27T12:40:02","modified_gmt":"2022-11-27T04:40:02","slug":"%e5%b5%8c%e5%a5%97%e5%be%aa%e7%8e%af%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=354","title":{"rendered":"Java\u57fa\u672c\u8bed\u6cd5-\u5d4c\u5957\u5faa\u73af\u7684\u4f7f\u7528"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/*\n\u5d4c\u5957\u5faa\u73af\u7684\u4f7f\u7528\n1. \u5d4c\u5957\u5faa\u73af\uff1a\u5c06\u4e00\u4e2a\u5faa\u73af\u7ed3\u6784A\u58f0\u660e\u5728\u53e6\u4e00\u4e2a\u5faa\u73af\u7ed3\u6784B\u7684\u5faa\u73af\u4f53\u4e2d\uff0c\u5c31\u6784\u6210\u4e86\u5d4c\u5957\u5faa\u73af\n\n2.\n\u5916\u5c42\u5faa\u73af\uff1a\u5faa\u73af\u7ed3\u6784B\n\u5185\u5c42\u5faa\u73af\uff1a\u5faa\u73af\u7ed3\u6784A\n\n3.\n\u2460 \u5185\u5c42\u5faa\u73af\u7ed3\u6784\u904d\u5386\u4e00\u904d\uff0c\u53ea\u76f8\u5f53\u4e8e\u5916\u5c42\u5faa\u73af\u5faa\u73af\u4f53\u6267\u884c\u4e86\u4e00\u6b21\n\u2461 \u5047\u8bbe\u5916\u5c42\u5faa\u73af\u9700\u8981\u6267\u884cm\u6b21\uff0c\u5185\u5c42\u5faa\u73af\u9700\u8981\u6267\u884cn\u6b21\u3002\u6b64\u65f6\u5185\u5c42\u5faa\u73af\u7684\u5faa\u73af\u4f53\u4e00\u5171\u6267\u884c\u4e86\uff1am * n\u6b21\n\n4. \u6280\u5de7\uff1a\n\t\u5916\u5c42\u5faa\u73af\u63a7\u5236\u884c\u6570\uff0c\u5185\u5c42\u5faa\u73af\u63a7\u5236\u5217\u6570\n*\/\n\nclass ForForTest{\n\tpublic static void main(String&#91;] args){\n\n\t\t\/\/******\n\t\t\/\/System.out.println(\"******\");\n\t\tfor(int i = 1; i &lt;= 6; i++){\n\t\t\tSystem.out.print('*');\n\t\t}\n\n\t\tSystem.out.println(\"\\n\");\n\n\t\t\/*\n\t\t******\n\t\t******\t\n\t\t******\n\t\t******\n\t\t*\/\n\n\n\t\tfor(int j = 1; j &lt;= 4; j++){\n\t\t\tfor(int i = 1; i &lt;= 6; i++){\n\t\t\t\tSystem.out.print('*');\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t\/*\t\ti(\u884c\u53f7)\tj(*\u7684\u4e2a\u6570)\n\t\t*\t\t1\t1\n\t\t**\t\t2\t2\n\t\t***\t\t3\t3\n\t\t****\t\t4\t4\n\t\t*****\t\t5\t5\n\t\t*\/\n\n\t\tfor(int i = 1; i &lt;= 5; i++){\/\/\u63a7\u5236\u884c\u6570\n\t\t\tfor(int j = 1; j &lt;= i; j++){\/\/\u63a7\u5236\u5217\u6570\n\t\t\t\tSystem.out.print(\"*\");\n\n\t\t\t}\n\t\t\tSystem.out.println();\t\t\t\n\t\t}\n\n\t\t\/*\t\ti(\u884c\u53f7)\tj(*\u7684\u4e2a\u6570)\t\t\u89c4\u5f8b\uff1ai + j = 5 \u6362\u53e5\u8bdd\u8bf4\uff1aj = 5 - i\n\t\t****\t\t1\t4\n\t\t***\t\t2\t3\n\t\t**\t\t3\t2\n\t\t*\t\t4\t1\n\t\t*\/\n\n\t\tfor(int i = 1; i &lt;= 4; i++){\n\t\t\tfor(int j = 1; j &lt;= 5 - i; j++){\/\/for(int j = 4; j &gt;= i; j--){\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\tSystem.out.println();\n\t\t}\n\n\t\t\/*\n\t\t*\n\t\t**\n\t\t***\n\t\t****\n\t\t*****\n\t\t****\n\t\t***\n\t\t**\n\t\t*\n\t\t*\/\n\n\t\tfor(int i = 1; i &lt;= 5; i++){\n\t\t\tfor(int j = 1; j&lt;= i ; j++){\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor(int i = 1; i &lt;= 4; i++){\n\t\t\tfor(int k = 4; k &gt;= i; k--){\n\t\t\t\tSystem.out.print(\"*\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t\/*\n\n\t\t    *\n\t\t   * *\n\t\t  * * *\n\t\t * * * *\n\t\t* * * * *\n\t\t * * * *\n\t\t  * * *\n\t\t   * *\n\t\t    *\n\t\t*\/\n\n\t\/\/\u4e0a\u534a\u90e8\u5206\n\n\t\/\/\u4e0b\u534a\u90e8\u5206\n\n\t\tfor(int i = 1; i &lt;= 5; i++){\n\t\t\tfor(int k = 4; k &gt;=i; k-- ){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j = 1; j &lt;= i; j++){\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor(int i = 1; i &lt;= 4; i++){\n\t\t\tfor(int k =1; k &lt;= i; k++){\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j = 4; j &gt;= i; j--){\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[46],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-java-code","tag-java"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/354"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354"}],"version-history":[{"count":2,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":514,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions\/514"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}