import java.util.Scanner; class Arithmetik { public static void main (String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Vorname: "); String vorname = scanner.nextLine(); System.out.print("Nachname: "); String nachname = scanner.nextLine(); System.out.print("x_1 = "); int x1 = scanner.nextInt(); System.out.print("x_2 = "); int x2 = scanner.nextInt(); System.out.print("Hallo " + vorname.substring(0,1) + ". " + nachname + "! "); if (x1 < x2) { System.out.println("Der Mittelwert von " + x1 + " und " + x2 + " ist übrigens " + ((x1 + x2) / 2.0) + "!"); } else if (x1 > 0 && x2 > 0) { System.out.println("Der Kehrwert von " + x1 + " ist ungefähr " + 1.0/x1 + "!"); } else { System.out.println(x1 + x2); } } }