From f3dedaff71c30997db1154c71db4eda035276ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E9=92=8A=E4=BC=9F?= <1319099240@qq.com> Date: Sat, 13 May 2023 01:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...12\344\275\234\344\270\232;import java.md" | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "35\345\217\267 \351\203\235\351\222\212\344\274\237/0512\344\275\234\344\270\232;import java.md" diff --git "a/35\345\217\267 \351\203\235\351\222\212\344\274\237/0512\344\275\234\344\270\232;import java.md" "b/35\345\217\267 \351\203\235\351\222\212\344\274\237/0512\344\275\234\344\270\232;import java.md" new file mode 100644 index 0000000..f401dca --- /dev/null +++ "b/35\345\217\267 \351\203\235\351\222\212\344\274\237/0512\344\275\234\344\270\232;import java.md" @@ -0,0 +1,30 @@ +```java +package Day0512; + +import java.text.DecimalFormat; +import java.util.InputMismatchException; +import java.util.Scanner; + +public class num { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int a= 0; + try { + a = sc.nextInt(); + } catch (InputMismatchException e) { + System.out.println("输入类型不匹配,请核实后再来"); + return; + } + int b= 0; + try { + b = sc.nextInt(); + } catch (InputMismatchException e1) { + System.out.println("输入类型不匹配,请核实后再来"); + return; + } + System.out.println(a+b); + } +} + +``` + -- Gitee