/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Scanner x
= new Scanner
(System.
in);
int soma = 0;
int posicao = 0;
double [] numeros = new double [20];
System.
out.
println("Digite 20 números para obter a média dos mesmos:");
while (posicao < numeros.length){
numeros [posicao] = x.nextDouble();
posicao++;
}
double media
= Arrays.
stream(numeros
).
average().
getAsDouble(); System.
out.
println("Média " + media
+ "\nNumeros abaixo da média:\n");
Arrays.
stream(numeros
).
filter(num
->num
< media
).
forEach(num
->System.
out.
println(num
));
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgeCA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgoJICAgIGludCBzb21hID0gMDsKCSAgICBpbnQgcG9zaWNhbyA9IDA7CgkgICAgZG91YmxlIFtdIG51bWVyb3MgPSBuZXcgZG91YmxlIFsyMF07CgkgICAgU3lzdGVtLm91dC5wcmludGxuKCJEaWdpdGUgMjAgbsO6bWVyb3MgcGFyYSBvYnRlciBhIG3DqWRpYSBkb3MgbWVzbW9zOiIpOwoJCgkgICAgd2hpbGUgKHBvc2ljYW8gPCBudW1lcm9zLmxlbmd0aCl7CgkgICAgICAgIG51bWVyb3MgW3Bvc2ljYW9dID0geC5uZXh0RG91YmxlKCk7CgkgICAgICAgIHBvc2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