From 90363a74cd9ecd5cbaa2136df4b2ee85c45d0036 Mon Sep 17 00:00:00 2001 From: wumingfang Date: Fri, 24 Feb 2023 17:38:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B0=B4=E4=BB=99=E8=8A=B1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShuiXianHua.java" | 30 +++++++++++++++++++ .../\347\256\200\345\215\225/exercies.md" | 20 +++++++++++++ .../\347\256\200\345\215\225/test_cases/1.in" | 1 + .../test_cases/10.in" | 1 + .../\347\256\200\345\215\225/test_cases/2.in" | 1 + .../\347\256\200\345\215\225/test_cases/3.in" | 1 + .../\347\256\200\345\215\225/test_cases/4.in" | 1 + .../\347\256\200\345\215\225/test_cases/5.in" | 1 + .../\347\256\200\345\215\225/test_cases/6.in" | 1 + .../\347\256\200\345\215\225/test_cases/7.in" | 1 + .../\347\256\200\345\215\225/test_cases/8.in" | 1 + .../\347\256\200\345\215\225/test_cases/9.in" | 1 + 12 files changed, 60 insertions(+) create mode 100644 "exercises/wumf/\347\256\200\345\215\225/ShuiXianHua.java" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/exercies.md" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/1.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/10.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/2.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/3.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/4.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/5.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/6.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/7.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/8.in" create mode 100644 "exercises/wumf/\347\256\200\345\215\225/test_cases/9.in" diff --git "a/exercises/wumf/\347\256\200\345\215\225/ShuiXianHua.java" "b/exercises/wumf/\347\256\200\345\215\225/ShuiXianHua.java" new file mode 100644 index 0000000..620f86e --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/ShuiXianHua.java" @@ -0,0 +1,30 @@ +import java.util.Scanner; + +/** + * @description: + * @author: wmf + * @create: 2022-10-13 14:21 + **/ +public class TestMain { + public static void main(String[] args) { + + Scanner myscanner = new Scanner(System.in); + System.out.println("请输入数字"); // 提示用户输入 + while(true){ + int number = myscanner.nextInt(); // 接收用户输入 + + int number1 = number / 100; // 取百位 + int number2 = number % 100 / 10; // 取十位 + int number3 = number % 10; // 取个位 + + if (number1 * number1 * number1 + + number2 * number2 * number2 + + number3 * number3 * number3 == number) { + System.out.println(number + "是水仙花数"); + } else { + System.out.println(number + "不是水仙花数"); + } + } + + } +} diff --git "a/exercises/wumf/\347\256\200\345\215\225/exercies.md" "b/exercises/wumf/\347\256\200\345\215\225/exercies.md" new file mode 100644 index 0000000..c4d52c7 --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/exercies.md" @@ -0,0 +1,20 @@ +# 水仙花数 + +水仙花数,一个三位数,其各位数字得立方和等于本身, +例如 153 = 1*1*1 + 5*5*5 + 3*3*3。 +输入一个数字,判断是否是水仙花数。 + +## 输入描述 +输入一个数字。 + +## 输出描述 +是否是水仙花数。 + +## 输入样例 +153 + +## 输出样例 +是 + +## 提示 +无 diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/1.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/1.in" new file mode 100644 index 0000000..f79f5e3 --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/1.in" @@ -0,0 +1 @@ +153 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/10.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/10.in" new file mode 100644 index 0000000..0ad1c6b --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/10.in" @@ -0,0 +1 @@ +408 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/2.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/2.in" new file mode 100644 index 0000000..d800886 --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/2.in" @@ -0,0 +1 @@ +123 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/3.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/3.in" new file mode 100644 index 0000000..df689d8 --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/3.in" @@ -0,0 +1 @@ +234 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/4.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/4.in" new file mode 100644 index 0000000..cf5106d --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/4.in" @@ -0,0 +1 @@ +999 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/5.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/5.in" new file mode 100644 index 0000000..ce125d2 --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/5.in" @@ -0,0 +1 @@ +879 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/6.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/6.in" new file mode 100644 index 0000000..ed4df3c --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/6.in" @@ -0,0 +1 @@ +666 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/7.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/7.in" new file mode 100644 index 0000000..6a3a789 --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/7.in" @@ -0,0 +1 @@ +587 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/8.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/8.in" new file mode 100644 index 0000000..6c8526a --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/8.in" @@ -0,0 +1 @@ +370 \ No newline at end of file diff --git "a/exercises/wumf/\347\256\200\345\215\225/test_cases/9.in" "b/exercises/wumf/\347\256\200\345\215\225/test_cases/9.in" new file mode 100644 index 0000000..1c3e15e --- /dev/null +++ "b/exercises/wumf/\347\256\200\345\215\225/test_cases/9.in" @@ -0,0 +1 @@ +371 \ No newline at end of file -- GitLab