import java.util.Scanner;
class Ex10 {
public static void main
(String[] args
) { Scanner x
= new Scanner
(System.
in);
System.
out.
println("Digite 3 valores em sequencia:"); int v1 = x.nextInt();
int v2 = x.nextInt();
int v3 = x.nextInt();
int a = v1, b = v2, c = v3;
// Se v1 for maior que v2, troca eles de lugar.
if (v1 > v2) {
int aux = v2;
v2 = v1;
v1 = aux;
}
// Se v1 for maior que v3, troca eles de lugar.
if (v1 > v3) {
int aux = v3;
v3 = v1;
v1 = aux;
}
// Se v2 for maior que v3, troca eles de lugar.
if (v2 > v3) {
int aux = v3;
v3 = v2;
v2 = aux;
}
System.
out.
println(v1
+ ", " + v2
+ ", " + v3
); System.
out.
println(a
+ ", " + b
+ ", " + c
); }
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgRXgxMCB7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU2Nhbm5lciB4ID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJEaWdpdGUgMyB2YWxvcmVzIGVtIHNlcXVlbmNpYToiKTsKICAgICAgICBpbnQgdjEgPSB4Lm5leHRJbnQoKTsKICAgICAgICBpbnQgdjIgPSB4Lm5leHRJbnQoKTsKICAgICAgICBpbnQgdjMgPSB4Lm5leHRJbnQoKTsKICAgICAgICBpbnQgYSA9IHYxLCBiID0gdjIsIGMgPSB2MzsKCiAgICAgICAgLy8gU2UgdjEgZm9yIG1haW9yIHF1ZSB2MiwgdHJvY2EgZWxlcyBkZSBsdWdhci4KICAgICAgICBpZiAodjEgPiB2MikgewogICAgICAgICAgICBpbnQgYXV4ID0gdjI7CiAgICAgICAgICAgIHYyID0gdjE7CiAgICAgICAgICAgIHYxID0gYXV4OwogICAgICAgIH0KCiAgICAgICAgLy8gU2UgdjEgZm9yIG1haW9yIHF1ZSB2MywgdHJvY2EgZWxlcyBkZSBsdWdhci4KICAgICAgICBpZiAodjEgPiB2MykgewogICAgICAgICAgICBpbnQgYXV4ID0gdjM7CiAgICAgICAgICAgIHYzID0gdjE7CiAgICAgICAgICAgIHYxID0gYXV4OwogICAgICAgIH0KCiAgICAgICAgLy8gU2UgdjIgZm9yIG1haW9yIHF1ZSB2MywgdHJvY2EgZWxlcyBkZSBsdWdhci4KICAgICAgICBpZiAodjIgPiB2MykgewogICAgICAgICAgICBpbnQgYXV4ID0gdjM7CiAgICAgICAgICAgIHYzID0gdjI7CiAgICAgICAgICAgIHYyID0gYXV4OwogICAgICAgIH0KICAgICAgICAKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4odjEgKyAiLCAiICsgdjIgKyAiLCAiICsgdjMpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihhICsgIiwgIiArIGIgKyAiLCAiICsgYyk7CiAgICB9ICAgIAp9