From f188f29ded01699de67a9a85c278f7928ea1ac93 Mon Sep 17 00:00:00 2001 From: pj3q7x5mz <1732875197@qq.com> Date: Mon, 21 Nov 2022 17:09:48 +0800 Subject: [PATCH] =?UTF-8?q?Delete=20'Java=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=B9=8Btry-catch=E4=B9=8B=E5=BC=82=E5=B8=B8=E6=8D=95?= =?UTF-8?q?=E8=8E=B7.txt'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...常处理之try-catch之异常捕获.txt | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 Java异常处理之try-catch之异常捕获.txt diff --git a/Java异常处理之try-catch之异常捕获.txt b/Java异常处理之try-catch之异常捕获.txt deleted file mode 100644 index d8695d2..0000000 --- a/Java异常处理之try-catch之异常捕获.txt +++ /dev/null @@ -1,28 +0,0 @@ - -import java.util.Scanner; - -public class ExcTest { - public static void main(String[] args) { - // 请在Begin-End间编写代码 - /********** Begin **********/ - // 第一步:接收给定的整数 - Scanner input=new Scanner(System.in); - int a = input.nextInt(); - int b = input.nextInt(); - int x; - // 第二步:求给定两个数的商,并捕获除数为0的异常 - try{ - x = a / b; - } - catch(Exception e){ - { - System.out.println("除数不能为0"); - } - } - if(b != 0){ - System.out.println(a / b); - } - /********** End **********/ - - } -} \ No newline at end of file