From 7c7e4a94228df914d91ef4d8d0deb2611e272597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A2=A6=E6=A2=A6?= <3195337478@qq.com> Date: Thu, 11 May 2023 03:28:11 +0000 Subject: [PATCH] =?UTF-8?q?=E8=BF=99=E6=98=AF=E9=99=88=E6=A2=A6=E6=A2=A6?= =?UTF-8?q?=E7=9A=84=E7=AC=AC=E5=8D=81=E5=9B=9B=E6=AC=A1=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈梦梦 <3195337478@qq.com> --- .../20230509\344\275\234\344\270\232.md" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "01 \351\231\210\346\242\246\346\242\246/20230509\344\275\234\344\270\232.md" diff --git "a/01 \351\231\210\346\242\246\346\242\246/20230509\344\275\234\344\270\232.md" "b/01 \351\231\210\346\242\246\346\242\246/20230509\344\275\234\344\270\232.md" new file mode 100644 index 0000000..a8d4740 --- /dev/null +++ "b/01 \351\231\210\346\242\246\346\242\246/20230509\344\275\234\344\270\232.md" @@ -0,0 +1,28 @@ +```java +package Day0509; + +import java.util.Scanner; + +public class D1 { + public static void main(String[] args) { + System.out.println("输入两个整数并求和"); + while (true) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入两个整数"); + + try { + + int a = sc.nextInt(); + int b = sc.nextInt(); + System.out.println("输入的两个数分别为"+a+"和"+b); + System.out.println("求出的和是"+(a+b)); + + } catch (Exception e) { + System.out.println("输入的是错误字符"); + } + + } + + } +} +``` -- Gitee