📄 suanfa.java
字号:
package com.wj;
import java.util.Scanner;
public class Suanfa {
int first;
int second;
public void suan() throws DBException {
java.util.Scanner ner = new Scanner(System.in);
System.out.println("请输入两个数---->");
first = ner.nextInt();
second = ner.nextInt();
try {
int result = first / second;
System.out.println(result);
} catch (Exception e) {
throw new DBException("除数不能为0");
}
}
public static void main(String[] args) {
try {
new Suanfa().suan();
} catch (DBException e) {
System.out.println(e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -