[Java] 纯文本查看 复制代码 import java.util.Scanner;
public class ExceptionDemo{
public static void main(String[] args){
System.out.println("SHU RU CHU SHU");
Scanner in = new Scanner(System.in);
int a = in.nextInt();
System.out.println("SHU RU BEI CHU SHU");
int b = in.nextInt();
devide(a,b);
}
public static int devide(int a, int b){
int c = 0;
try{
c= a/b;
}catch(Exception e){
System.out.println("chushubunnegwei0");
}
return c;
}
} |