Files

22 lines
653 B
Java
Raw Permalink Normal View History

2017-02-24 00:24:47 -06:00
// Author: Rodney Shaghoulian
2018-07-27 16:45:56 -07:00
// Github: github.com/RodneyShag
// HackerRank: hackerrank.com/RodneyShag
2017-02-24 00:24:47 -06:00
import java.util.Scanner;
import java.util.InputMismatchException;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
try {
int x = scan.nextInt();
int y = scan.nextInt();
System.out.println(x/y);
} catch (InputMismatchException e) {
System.out.println(e.getClass().getName());
} catch (ArithmeticException e) {
System.out.println(e.getClass().getName() + ": / by zero");
}
}
}