{"id":1583,"date":"2024-11-26T21:09:17","date_gmt":"2024-11-26T13:09:17","guid":{"rendered":"https:\/\/note.ui11.cc\/?p=1583"},"modified":"2024-11-27T09:50:17","modified_gmt":"2024-11-27T01:50:17","slug":"%e6%96%87%e4%bb%b6%e6%90%9c%e7%b4%a2-%e6%96%b9%e6%b3%95%e9%80%92%e5%bd%92","status":"publish","type":"post","link":"https:\/\/note.ui11.cc\/index.php\/2024\/11\/26\/%e6%96%87%e4%bb%b6%e6%90%9c%e7%b4%a2-%e6%96%b9%e6%b3%95%e9%80%92%e5%bd%92\/","title":{"rendered":"\u6587\u4ef6\u641c\u7d22-\u65b9\u6cd5\u9012\u5f52"},"content":{"rendered":"\n<p>\u9012\u5f52\u662f\u4e00\u79cd\u7b97\u6cd5\uff0c\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u4e2d\u5e7f\u6cdb\u5e94\u7528\uff0c\u4ece\u5f62\u5f0f\u4e0a\u8bf4\uff0c\u65b9\u6cd5\u8c03\u7528\u81ea\u8eab\u5f97\u5f62\u5f0f\u79f0\u4e3a\u65b9\u6cd5\u9012\u5f52<\/p>\n\n\n\n<p>\u9012\u5f52\u7684\u5f62\u5f0f\uff1a<\/p>\n\n\n\n<p>\u76f4\u63a5\u9012\u5f52\uff1a\u65b9\u6cd5\u81ea\u5df1\u8c03\u7528\u81ea\u5df1<\/p>\n\n\n\n<p>\u95f4\u63a5\u9012\u5f52\uff1a\u65b9\u6cd5\u8c03\u7528\u522b\u7684\u65b9\u6cd5\uff0c\u800c\u522b\u7684\u65b9\u6cd5\u53c8\u8c03\u7528\u81ea\u5df1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.file.test;\n\npublic class RecursionTest {\n\/\/    \u76f4\u63a5\u9012\u5f52\n    public static void main(String&#91;] args) {\n        test1();\n    }\n\n    public static void test1(){\n        System.out.println(\"Test1\");\n            test1();\n            }\n\n\n\/\/\u95f4\u63a5\u9012\u5f52\n            public static void test2(){\n                System.out.println(\"test2\");\n                test3();\n            }\n            public static void test3(){\n\n                test2();\n            }\n}\n\n\n<\/code><\/pre>\n\n\n\n<p>\u6848\u4f8b\uff1a\u8ba1\u7b97\u4e00\u4e2a\u6570\u7684\u9636\u4e58<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.file.test;\n\nimport java.util.Scanner;\n\npublic class Ntest {\n\n    public static void main(String&#91;] args) {\n\n        System.out.println(\"\u8ba1\u7b97N\u7684\u9636\u4e58\");\n        System.out.println(\"\u8bf7\u8f93\u5165N\u7684\u503c\");\n        Scanner sc = new Scanner(System.in);\n        int n = sc.nextInt();\n        sc.close();\n        int x=1;\n        int y=1;\n        while (x&lt;=n) {\n          y=y*n;\n          n--;\n\n        }\n        System.out.println(\"N\u7684\u9636\u4e58\u4e3a\"+y5);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>\u5229\u7528\u9012\u5f52\u6765\u89e3\u51b3\u9636\u4e58\u95ee\u9898\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.file.test;\n\nimport java.util.Scanner;\n\npublic class Ntest {\n\n    public static void main(String&#91;] args) {\n\n\/\/        System.out.println(\"\u8ba1\u7b97N\u7684\u9636\u4e58\");\n\/\/        System.out.println(\"\u8bf7\u8f93\u5165N\u7684\u503c\");\n\/\/        Scanner sc = new Scanner(System.in);\n\/\/        int n = sc.nextInt();\n\/\/        sc.close();\n\/\/        int x=1;\n\/\/        int y=1;\n\/\/        while (x&lt;=n) {\n\/\/          y=y*n;\n\/\/          n--;\n\/\/\n\/\/        }\n\/\/        System.out.println(\"N\u7684\u9636\u4e58\u4e3a\"+y);\n        System.out.println(\"\u5229\u7528\u65b9\u6cd5\u9012\u5f52\u6765\u5b9e\u73b0\u9636\u4e58\");\n       Scanner scanner = new Scanner(System.in);\n        int i = scanner.nextInt();\n        int f = f(i);\n        System.out.println(\"\u9636\u4e58\u4e3a\uff1a\"+f);\n\n\n    }\n    public static int f(int n){\n\n        if(n==1){\n            return 1;\n\n        }else {\n            return f(n-1)*n;\n\n        }\n\n    }\n\n}\n<\/code><\/pre>\n\n\n\n<p><strong>\u6587\u4ef6\u641c\u7d22\u6848\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-153-1024x525.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"525\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-153-1024x525.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1584\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.file.test;\n\n\nimport java.io.File;\n\npublic class uninstDemo {\n\n    public static void main(String&#91;] args) {\n        \/\/\u5728\u6587\u4ef6D\u76d8\u4e0b\u627e\u51fauninst.exe\u6587\u4ef6\u6240\u5728\u4f4d\u7f6e\n        \n        SearchUninst(new File(\"D:\/\"),\"uninst.exe\");\n        \n    }\n    \/**\n     *\n     *\n     * \u76ee\u5f55\u4e0b\u641c\u7d22\u67d0\u4e2a\u6587\u4ef6\n     *\n     * dir :\u76ee\u5f55\n     *\n     * fileName:\u6587\u4ef6\u540d\u79f0\n     *\n     *\/\n    public static void SearchUninst(File dir, String fileName) {\n\n        if(dir==null || !dir.exists() || !dir.isDirectory()) {\n\n            System.out.println(\"\u975e\u6cd5\u53c2\u6570\uff0c\u65e0\u6cd5\u641c\u7d22\");\n            return;\n\n        }\n        \/\/dir\u4e0d\u662fnull,\u5b58\u5728\uff0c\u662f\u76ee\u5f55\n        \/\/ \u83b7\u53d6\u6587\u4ef6\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u4e00\u7ea7\u6587\u4ef6\u5bf9\u8c61\n        \/\/\u904d\u5386\u4e00\u7ea7\u6587\u4ef6\u5bf9\u8c61\n        File&#91;] files = dir.listFiles();\/\/\u5f97\u5230\u4e00\u4e2a\u4e00\u7ea7\u6587\u4ef6\u5bf9\u8c61\u6570\u7ec4\n        \/\/\u5224\u65ad\u5f53\u524d\u76ee\u5f55\u4e0b\u662f\u5426\u5b58\u5728\u4e00\u7ea7\u6587\u4ef6\u5bf9\u8c61\uff0c\u6216\u8005\u662f\u5426\u53ef\u4ee5\u62ff\u5230\u4e00\u7ea7\u6587\u4ef6\u5bf9\u8c61\n        if(files!=null &amp;&amp; files.length>0) {\n            for (File file : files) {\n                \/\/\u5224\u65ad\u6587\u4ef6\u662f\u5426\u662f\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\n            if(file.isFile()){\n                \/\/\u5224\u65ad\u662f\u5426\u662f\u6211\u4eec\u8981\u627e\u7684\u6587\u4ef6\n                if(fileName.equals(file.getName())) {\n                    System.out.println(\"\u627e\u5230\u4e86\"+file.getAbsolutePath());\n                }\n            }\n\n            if(file.isDirectory()){\n                SearchUninst(file, fileName);\n            }\n\n            }\n\n        }\n\n    }\n\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9012\u5f52\u662f\u4e00\u79cd\u7b97\u6cd5\uff0c\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u4e2d\u5e7f\u6cdb\u5e94\u7528\uff0c\u4ece\u5f62\u5f0f\u4e0a\u8bf4\uff0c\u65b9\u6cd5\u8c03\u7528\u81ea\u8eab\u5f97\u5f62\u5f0f\u79f0\u4e3a\u65b9\u6cd5\u9012\u5f52 \u9012\u5f52\u7684\u5f62\u5f0f\uff1a \u76f4\u63a5\u9012\u5f52\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-1583","post","type-post","status-publish","format-standard","hentry","category-fileio"],"_links":{"self":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/comments?post=1583"}],"version-history":[{"count":1,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1583\/revisions"}],"predecessor-version":[{"id":1585,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1583\/revisions\/1585"}],"wp:attachment":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/media?parent=1583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/categories?post=1583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/tags?post=1583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}