- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
Latest commit
16 lines (15 loc) · 506 Bytes
/
Copy pathSolution.java
File metadata and controls
16 lines (15 loc) · 506 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
importjava.util.InputMismatchException;
importjava.util.Scanner;
publicclassSolution {
publicstaticvoidmain(String[] args) {
try (Scannerscan = newScanner(System.in)) {
intx = scan.nextInt();
inty = scan.nextInt();
System.out.println(x / y);
} catch (InputMismatchExceptione) {
System.out.println(e.getClass().getCanonicalName());
} catch (ArithmeticExceptione) {
System.out.println(e);
}
}
}