{"id":1090,"date":"2022-05-17T16:04:22","date_gmt":"2022-05-17T08:04:22","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1090"},"modified":"2022-05-17T16:04:22","modified_gmt":"2022-05-17T08:04:22","slug":"%e5%bf%ab%e6%89%8b-%e7%94%b5%e5%95%86%e6%9c%8d%e5%8a%a1%e7%ab%af%e6%b5%8b%e8%af%95%e5%b7%a5%e7%a8%8b%e5%b8%88%e4%b8%80%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2022\/05\/17\/%e5%bf%ab%e6%89%8b-%e7%94%b5%e5%95%86%e6%9c%8d%e5%8a%a1%e7%ab%af%e6%b5%8b%e8%af%95%e5%b7%a5%e7%a8%8b%e5%b8%88%e4%b8%80%e9%9d%a2\/","title":{"rendered":"\u5feb\u624b-\u7535\u5546\u670d\u52a1\u7aef\u6d4b\u8bd5\u5de5\u7a0b\u5e08\u4e00\u9762\u73b0\u573a\u7f16\u7a0b\u9898"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>package Test;\n\/*\nAuthor:Sanro\nTime:2022.05.17 16:00:56\nBlog:https:\/\/sanlangcode.com\nEmail:sanlangcode@163.com\nDesc:\n*\/\n\nimport java.util.*;\nimport java.io.*;\n\npublic class Solution {\n    \/*1\u3001\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\uff0c\u8981\u6c42\u4f20\u5165\u4e00\u4e2a\u6570\u7ec4\uff0c\n    \u4f7f\u5947\u6570\u5728\u5076\u6570\u524d\u9762;*\/\n    public static class Main {\n        public static void main(String&#91;] args) {\n            int&#91;] nums = {1,3,4,6,5,7};\n            solution(nums);\n        }\n        public static void solution(int&#91;] nums){\n            int len = nums.length;\n            Arrays.sort(nums);\/\/\u7b2c\u4e00\u6b65\uff1a\u5148\u6392\u5e8f\n            int&#91;] nums_ji = new int&#91;len];\n            int&#91;] nums_ou = new int&#91;len];\n            for(int i =0 ; i&lt;len ; i++){ \/\/\u7b2c\u4e8c\u6b65\uff1a\u5206\u5947\u5076\n                if (nums&#91;i]%2==0){ nums_ou&#91;i]=nums&#91;i];}\n                else{ nums_ji&#91;i] = nums&#91;i];}\n            }\n            for(int i =0 ; i&lt;len ; i++){\/\/\u7b2c\u4e09\u6b65\uff1a\u518d\u6bd4\u8f83\u8f93\u51fa\n                if(nums_ji&#91;i]>nums_ou&#91;i]) System.out.println(nums_ji&#91;i]);\n                else System.out.println(nums_ou&#91;i]);\n            }\n        }\n    }\n\n}\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9-1024x538.png\" alt=\"\" class=\"wp-image-1091\" srcset=\"https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9-1024x538.png 1024w, https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9-300x158.png 300w, https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9-768x403.png 768w, https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9-1536x806.png 1536w, https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9-670x352.png 670w, https:\/\/sanlangcode.com\/wp-content\/uploads\/2022\/05\/image-9.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1075,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1090","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/comments?post=1090"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1090\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media\/1075"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}