import java.util.Scanner;
class Ideone {
public static void main
(String[] args
) { Scanner input
= new Scanner
(System.
in); int number;
int max = 0;
int min = 0;
int countMax = 0;
int countMin = 0;
for (int x = 0; x < 3; x++) {
System.
out.
print("Give me an integer: "); number = input.nextInt();
if (x == 0 || number > max) {
countMax = 1;
max = number;
} else if (number == max) {
countMax++;
}
if (x == 0 || number < min) {
countMin = 1;
min = number;
} else if (number == min) {
countMin++;
}
}
System.
out.
println("Highest value: " + max
);
System.
out.
println("Count of highest values: " + countMax
);
System.
out.
println("Lowest value: " + min
);
System.
out.
println("Count of lowest values: " + countMin
); }
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwogCiBjbGFzcyBJZGVvbmUgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIFNjYW5uZXIgaW5wdXQgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgICAgIGludCBudW1iZXI7CiAgICAgICAgaW50IG1heCA9IDA7CiAgICAgICAgaW50IG1pbiA9IDA7CiAgICAgICAgaW50IGNvdW50TWF4ID0gMDsKICAgICAgICBpbnQgY291bnRNaW4gPSAwOwogCiAgICAgICAgZm9yIChpbnQgeCA9IDA7IHggPCAzOyB4KyspIHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludCgiR2l2ZSBtZSBhbiBpbnRlZ2VyOiAiKTsKICAgICAgICAgICAgbnVtYmVyID0gaW5wdXQubmV4dEludCgpOwogCiAgICAgICAgICAgIGlmICh4ID09IDAgfHwgbnVtYmVyID4gbWF4KSB7CiAgICAgICAgICAgICAgICBjb3VudE1heCA9IDE7CiAgICAgICAgICAgICAgICBtYXggPSBudW1iZXI7CiAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09IG1heCkgewogICAgICAgICAgICAgICAgY291bnRNYXgrKzsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoeCA9PSAwIHx8IG51bWJlciA8IG1pbikgewogICAgICAgICAgICAgICAgY291bnRNaW4gPSAxOwogICAgICAgICAgICAgICAgbWluID0gbnVtYmVyOwogICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PSBtaW4pIHsKICAgICAgICAgICAgICAgIGNvdW50TWluKys7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkhpZ2hlc3QgdmFsdWU6ICIgKyBtYXgpOwogCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJDb3VudCBvZiBoaWdoZXN0IHZhbHVlczogIiArIGNvdW50TWF4KTsKIAogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiTG93ZXN0IHZhbHVlOiAiICsgbWluKTsKIAogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQ291bnQgb2YgbG93ZXN0IHZhbHVlczogIiArIGNvdW50TWluKTsKICAgIH0KfQ==