// IntArithmetik.java
import java.util.Scanner;

/**
 * IntArithmetik testet die arithmetischen Operatoren mit ganzen Zahlen.
 * Beispielprogramm zur Programmiertechnik 1, Teil 3.
 * @author H.Drachenfels
 * @version 17.3.2023
 */
public final class IntArithmetik {
    private IntArithmetik() { }

    private static final Scanner EINGABE = new Scanner(System.in);

    /**
     * main ist der Startpunkt des Programms.
     * @param args wird nicht verwendet.
     */
    public static void main(String[] args) {
        System.out.print("Zwei ganze Zahlen eingeben: ");

        int a = EINGABE.nextInt();
        int b = EINGABE.nextInt();

        System.out.printf("-(%d): %d%n", a, -a);
        System.out.printf("~%d: %d%n", a, ~a);
        System.out.printf("~%d: %d%n", b, ~b);
        System.out.printf("%d + %d: %d%n", a, b, a + b);
        System.out.printf("%d - %d: %d%n", a, b, a - b);
        System.out.printf("%d * %d: %d%n", a, b, a * b);
        System.out.printf("%d / %d: %d%n", a, b, a / b);
        System.out.printf("%d %% %d: %d%n", a, b, a % b);
        System.out.printf("%d / %d: %d%n", b, a, b / a);
        System.out.printf("%d %% %d: %d%n", b, a, b % a);
        System.out.printf("%d & %d: %d%n", a, b, a & b);
        System.out.printf("%d | %d: %d%n", a, b, a | b);
        System.out.printf("%d ^ %d: %d%n", a, b, a ^ b);
        System.out.printf("%d << %d: %d%n", a, b, a << b);
        System.out.printf("%d >> %d: %d%n", a, b, a >> b);
        System.out.printf("%d >>> %d: %d%n", a, b, a >>> b);
        System.out.printf("-(%d) >> %d: %d%n", a, b, -a >> b);
        System.out.printf("-(%d) >>> %d: %d%n", a, b, -a >>> b);
    }
}

