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 0000000000000000000000000000000000000000..620f86eecbd993eaeda79e6fa4e332690800b78e --- /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 0000000000000000000000000000000000000000..c4d52c72d80db995d5f65d0231eba5df203442e9 --- /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 0000000000000000000000000000000000000000..f79f5e337ea18102bf116113d489fb73bd210e37 --- /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 0000000000000000000000000000000000000000..0ad1c6bd5336956c01570239af16406ed6ae7a5e --- /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 0000000000000000000000000000000000000000..d800886d9c86731ae5c4a62b0b77c437015e00d2 --- /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 0000000000000000000000000000000000000000..df689d8406115cd383b647e35c7b49dc93703f79 --- /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 0000000000000000000000000000000000000000..cf5106d72affa73ca65e0f046ee86a98e01f3a83 --- /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 0000000000000000000000000000000000000000..ce125d2e2876748bf9cfde827311e1f030a11f06 --- /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 0000000000000000000000000000000000000000..ed4df3c909416ce15dc1a8653600d7ff03c6e99c --- /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 0000000000000000000000000000000000000000..6a3a7891aadb70dbd69ce6bd0fdaf9da3c098c3e --- /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 0000000000000000000000000000000000000000..6c8526a81eca52ace7878a2759299fe60c0b61a3 --- /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 0000000000000000000000000000000000000000..1c3e15e55e92fba0f98a8c87b771de24437edeb2 --- /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