/* 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=0;i<vet.length;i++)
{
vet[i]=-vet[i];
}
for(int i=0;i<vet.length;i++)
{
vet[i]=-vet[i];
}
System.
out.
println("Array em ordem decrescente:");
for (int n : vet) {
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWludFtdIHZldCA9IHsgNywgLTQsIDEwLCA4LCAyLCA1IH07CgoJCVN5c3RlbS5vdXQucHJpbnRsbigiQXJyYXkgc2VtIG9yZGVuYWNhbzoiKTsKCgkJZm9yIChpbnQgbiA6IHZldCkgewoJCQlTeXN0ZW0ub3V0LnByaW50KG4gKyAiICIpOwoJCX0KCQlTeXN0ZW0ub3V0LnByaW50bG4oKTsKCgkJZm9yKGludCBpPTA7aTx2ZXQubGVuZ3RoO2krKykKCQl7CgkJCXZldFtpXT0tdmV0W2ldOwoJCX0KCQkgICAgCgkJQXJyYXlzLnNvcnQodmV0KTsKCQkKCQlmb3IoaW50IGk9MDtpPHZldC5sZW5ndGg7aSsrKQoJCXsKCQkgICAgdmV0W2ldPS12ZXRbaV07CQoJCX0KCgkJU3lzdGVtLm91dC5wcmludGxuKCJBcnJheSBlbSBvcmRlbSBkZWNyZXNjZW50ZToiKTsKCgkJZm9yIChpbnQgbiA6IHZldCkgewoJCQlTeXN0ZW0ub3V0LnByaW50KG4gKyAiICIpOwoJCX0KCQlTeXN0ZW0ub3V0LnByaW50bG4oKTsKCX0KfQ==