Skip to content

Commit 4e568fb

Browse files
authored
Add files via upload
1 parent cd3d03b commit 4e568fb

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.io.*;
2+
import java.util.*;
3+
import java.text.*;
4+
import java.math.*;
5+
import java.util.regex.*;
6+
7+
public class Solution {
8+
9+
public static void main(String[] args) {
10+
11+
12+
Scanner scan = new Scanner(System.in);
13+
try {
14+
int x = scan.nextInt();
15+
int y = scan.nextInt();
16+
System.out.println(x / y);
17+
}
18+
catch(ArithmeticException | InputMismatchException e) {
19+
if (e instanceof ArithmeticException) {
20+
System.out.println("java.lang.ArithmeticException: / by zero");
21+
} else if (e instanceof InputMismatchException){
22+
System.out.println("java.util.InputMismatchException");
23+
}
24+
}
25+
scan.close();
26+
}
27+
28+
29+
}

0 commit comments

Comments
 (0)