{"id":965,"date":"2023-09-23T09:48:22","date_gmt":"2023-09-23T01:48:22","guid":{"rendered":"https:\/\/swordofmorning.com\/?p=965"},"modified":"2025-10-09T13:55:18","modified_gmt":"2025-10-09T05:55:18","slug":"android-development-02","status":"publish","type":"post","link":"https:\/\/swordofmorning.com\/index.php\/2023\/09\/23\/android-development-02\/","title":{"rendered":"Android Development 02 Challenge 2"},"content":{"rendered":"<p><center>\u53c2\u8003\u89c6\u9891\uff1a<a href=\"https:\/\/www.youtube.com\/watch?v=fis26HvvDII&t=3601s\" target=\"_blank\"  rel=\"nofollow\" >Android Development for Beginners - Full Course<\/a><\/center><\/p>\n<p>&emsp;&emsp;\u4e00\u4e2a\u7b80\u5355\u7684\u731c\u6570\u6e38\u620f\uff1a<\/p>\n<pre><code class=\"language-java\">import java.util.Random;\nimport java.util.Scanner;\n\npublic class Main {\n    public static void main(String[] args) {\n\n    \/* Username *\/\n        System.out.print(&quot;Input Username: &quot;);\n\n        String username = new Scanner(System.in).next();\n\n        System.out.println(&quot;Welcome &quot; + username + &quot;, we&#039;ll generate a random integer in [0, 100].&quot;);\n\n    \/* Generate Random Number *\/\n        Random rnd = new Random();\n        int target = rnd.nextInt(100);\n\n    \/* Loop *\/\n        boolean loop_flag = true;\n        while (loop_flag)\n        {\n            System.out.println(&quot;input number: &quot;);\n            int input = new Scanner(System.in).nextInt();\n\n            if (input == target)\n            {\n                System.out.println(&quot;The number you give is equal to target: &quot; + target);\n                loop_flag = false;\n            }\n            else if (input &lt; target)\n                System.out.println(&quot;The number you give is less than target&quot;);\n            else\n                System.out.println(&quot;The number you give is great than target&quot;);\n\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u89c6\u9891\uff1aAndroid Development for Beginners &#8211; Full Course &emsp;&emsp; &#823","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/965"}],"collection":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/comments?post=965"}],"version-history":[{"count":1,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/965\/revisions"}],"predecessor-version":[{"id":966,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/965\/revisions\/966"}],"wp:attachment":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/media?parent=965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/categories?post=965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/tags?post=965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}