From 78db5a45bbcf14b4e23115903e9e68522330885b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BF=8A=E5=85=B4?= <3250103239@qq.com> Date: Thu, 11 May 2023 10:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E5=8D=81=E5=9B=9B=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20230509 \345\274\202\345\270\270.md" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "14 \346\235\216\344\277\212\345\205\264/20230509 \345\274\202\345\270\270.md" 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 0000000..e1cde94 --- /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(); + } + } + } + } + + +~~~ + -- Gitee