diff --git "a/14 \346\235\216\344\277\212\345\205\264/20230509 \345\274\202\345\270\270.md" "b/14 \346\235\216\344\277\212\345\205\264/20230509 \345\274\202\345\270\270.md" new file mode 100644 index 0000000000000000000000000000000000000000..e1cde942e724d5411337b04829559b5b6a6fef13 --- /dev/null +++ "b/14 \346\235\216\344\277\212\345\205\264/20230509 \345\274\202\345\270\270.md" @@ -0,0 +1,29 @@ +## 作业 + +~~~java +package Demo1; + +import java.util.Scanner; + +public class D1 { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + while (true) { + try { + System.out.println("输入第一个数:"); + int a = sc.nextInt(); + System.out.println("输入第二个数:"); + int b = sc.nextInt(); + System.out.println("它们的和为:"+(a+b)); + break; + } catch (Exception e) { + System.out.println("输入整数"); + sc.nextLine(); + } + } + } + } + + +~~~ +