/* 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
{
{
int[] vet = { 7, 4, 10, 8, 2, 5 };
System.
out.
println("Array sem ordenacao:");
for (int n : vet) {
}
for (int i = 1; i < vet.length; i++) {
for (int j = 0; j < i; j++) {
if (vet[i] > vet[j]) {
int aux = vet[i];
vet[i] = vet[j];
vet[j] = aux;
}
}
}
System.
out.
println("Array em ordem decrescente:");
for (int n : vet) {
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCQkJaW50W10gdmV0ID0geyA3LCA0LCAxMCwgOCwgMiwgNSB9OwoKCQlTeXN0ZW0ub3V0LnByaW50bG4oIkFycmF5IHNlbSBvcmRlbmFjYW86Iik7CgoJCWZvciAoaW50IG4gOiB2ZXQpIHsKCQkJU3lzdGVtLm91dC5wcmludChuICsgIiAiKTsKCQl9CgkJU3lzdGVtLm91dC5wcmludGxuKCk7CgoJCWZvciAoaW50IGkgPSAxOyBpIDwgdmV0Lmxlbmd0aDsgaSsrKSB7CgkJCWZvciAoaW50IGogPSAwOyBqIDwgaTsgaisrKSB7CgkJCQlpZiAodmV0W2ldID4gdmV0W2pdKSB7CgkJCQkJaW50IGF1eCA9IHZldFtpXTsKCQkJCQl2ZXRbaV0gPSB2ZXRbal07CgkJCQkJdmV0W2pdID0gYXV4Owo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