import java.util.Scanner;
class CalculateAverage {
public static void main
(String[] args
) { Scanner scanner
= new Scanner
(System.
in);
System.
out.
print("Enter the first number: "); int num1 = scanner.nextInt();
System.
out.
print("Enter the second number: "); int num2 = scanner.nextInt();
// Calculate the average
double average = (double) (num1 + num2) / 2;
System.
out.
println("The average of " + num1
+ " and " + num2
+ " is: " + average
);
scanner.close();
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwpjbGFzcyBDYWxjdWxhdGVBdmVyYWdlIHsKCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU2Nhbm5lciBzY2FubmVyID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCiAgICAgICAgU3lzdGVtLm91dC5wcmludCgiRW50ZXIgdGhlIGZpcnN0IG51bWJlcjogIik7CiAgICAgICAgaW50IG51bTEgPSBzY2FubmVyLm5leHRJbnQoKTsKCiAgICAgICAgU3lzdGVtLm91dC5wcmludCgiRW50ZXIgdGhlIHNlY29uZCBudW1iZXI6ICIpOwogICAgICAgIGludCBudW0yID0gc2Nhbm5lci5uZXh0SW50KCk7CgogICAgICAgIC8vIENhbGN1bGF0ZSB0aGUgYXZlcmFnZQogICAgICAgIGRvdWJsZSBhdmVyYWdlID0gKGRvdWJsZSkgKG51bTEgKyBudW0yKSAvIDI7CgogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiVGhlIGF2ZXJhZ2Ugb2YgIiArIG51bTEgKyAiIGFuZCAiICsgbnVtMiArICIgaXM6ICIgKyBhdmVyYWdlKTsKCiAgICAgICAgc2Nhbm5lci5jbG9zZSgpOwogICAgfQp9