30 lines
684 B
Java
30 lines
684 B
Java
import java.util.InputMismatchException;
|
|
import java.util.Scanner;
|
|
public class Aufgabe {
|
|
public static void main(String args[]) {
|
|
Scanner input = new Scanner(System.in);
|
|
int a;
|
|
int b;
|
|
|
|
try {
|
|
System.out.print("A = ");
|
|
a = input.nextInt();
|
|
System.out.print("B = ");
|
|
b = input.nextInt();
|
|
|
|
System.out.println("a : b = " + a/b);
|
|
} catch(ArithmeticException e) {
|
|
System.out.println("Bei der Berechnung gab es Problem");
|
|
System.out.println("Problem: Dividiederen durch Null");
|
|
} catch (InputMismatchException e) {
|
|
System.out.println("Geben Sie ganzzahlige Zahl");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|