{"id":1232,"date":"2022-05-30T14:08:49","date_gmt":"2022-05-30T06:08:49","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1232"},"modified":"2022-05-30T14:08:49","modified_gmt":"2022-05-30T06:08:49","slug":"hj73-%e8%ae%a1%e7%ae%97%e6%97%a5%e6%9c%9f%e5%88%b0%e5%a4%a9%e6%95%b0%e8%bd%ac%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2022\/05\/30\/hj73-%e8%ae%a1%e7%ae%97%e6%97%a5%e6%9c%9f%e5%88%b0%e5%a4%a9%e6%95%b0%e8%bd%ac%e6%8d%a2\/","title":{"rendered":"HJ73 \u8ba1\u7b97\u65e5\u671f\u5230\u5929\u6570\u8f6c\u6362"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u63cf\u8ff0<\/h2>\n\n\n\n<p>\u6839\u636e\u8f93\u5165\u7684\u65e5\u671f\uff0c\u8ba1\u7b97\u662f\u8fd9\u4e00\u5e74\u7684\u7b2c\u51e0\u5929\u3002\u4fdd\u8bc1\u5e74\u4efd\u4e3a4\u4f4d\u6570\u4e14\u65e5\u671f\u5408\u6cd5\u3002\u8fdb\u9636\uff1a\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(n)\\<em>O<\/em>(<em>n<\/em>)&nbsp;\uff0c\u7a7a\u95f4\u590d\u6742\u5ea6\uff1aO(1)\\<em>O<\/em>(1)&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u8f93\u5165\u4e00\u884c\uff0c\u6bcf\u884c\u7a7a\u683c\u5206\u5272\uff0c\u5206\u522b\u662f\u5e74\uff0c\u6708\uff0c\u65e5<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u51fa\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u8f93\u51fa\u662f\u8fd9\u4e00\u5e74\u7684\u7b2c\u51e0\u5929<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b1<\/h2>\n\n\n\n<p>\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2012 12 31<\/pre>\n\n\n\n<p>\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">366<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.Calendar;\nimport java.util.Scanner;\n\npublic class Main {\n    public static void main(String&#91;] args) {\n        Scanner in=new Scanner(System.in);\n        int y=in.nextInt();\n        int m=in.nextInt();\n        int d=in.nextInt();\n        Calendar c1=Calendar.getInstance();\/\/\u5b9e\u4f8b\u5316\n        c1.set(y, m-1, d);\/\/\u6ce8\u610f\u6708\u4efd\u4ece0\u5f00\u59cb\n        System.out.println(c1.get(Calendar.DAY_OF_YEAR));\n    }\n\n}\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.Scanner;\n\n\npublic class Main{\n\n    public static void main(String&#91;] args){\n        Scanner sc = new Scanner(System.in);\n        while(sc.hasNext()){\n            int year = sc.nextInt();\n            int month = sc.nextInt();\n            int day = sc.nextInt();\n            int&#91;] month_day = {31,28,31,30,31,30,31,31,30,31,30,31};\n            int sum = 0;\n            for(int i = 0; i &lt; month - 1; i++){\n                sum += month_day&#91;i];\n            }\n            sum += day;\n            if(month > 2 &amp;&amp; is_leap(year)){\n                sum += 1;\n            }\n            System.out.println(sum);\n        }\n    }\n\n    public static boolean is_leap(int n){\n        if(n % 4 == 0 &amp;&amp; n % 100 != 0 || n % 400 == 0){\n            return true;\n        }else{\n            return false;\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u63cf\u8ff0 \u6839\u636e\u8f93\u5165\u7684\u65e5\u671f\uff0c\u8ba1\u7b97\u662f\u8fd9\u4e00&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1232","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=1232"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1232\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media\/1122"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}