class Ideone {
public static void main
(String[] args
) { int[] firstArray = new int[10];
int[] secondArray = new int[10];
for (int i = 0; i < firstArray.length; i++) {
firstArray
[i
] =(int)Math.
round(Math.
random() * 50); }
for (int i = firstArray.length - 1; i >= 0; i--) {
secondArray[secondArray.length - i - 1] = firstArray[i];
}
System.
out.
println("\nPrimeiro Array:"); for (int i = 0; i < firstArray.length; i++) {
System.
out.
print(firstArray
[i
] + "; "); }
System.
out.
println("\nSegundo Array:"); for (int i = 0; i < secondArray.length; i++) {
System.
out.
print(secondArray
[i
] + "; "); }
}
}
Y2xhc3MgSWRlb25lIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKQl7CgkgICAgaW50W10gZmlyc3RBcnJheSA9IG5ldyBpbnRbMTBdOwoJICAgIGludFtdIHNlY29uZEFycmF5ID0gbmV3IGludFsxMF07CgkgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBmaXJzdEFycmF5Lmxlbmd0aDsgaSsrKSB7CgkgICAgICAgIGZpcnN0QXJyYXlbaV0gPShpbnQpTWF0aC5yb3VuZChNYXRoLnJhbmRvbSgpICogNTApOwoJICAgIH0KCSAgICBmb3IgKGludCBpID0gZmlyc3RBcnJheS5sZW5ndGggLSAxOyBpID49IDA7IGktLSkgewogICAgICAgICAgICBzZWNvbmRBcnJheVtzZWNvbmRBcnJheS5sZW5ndGggLSBpIC0gMV0gPSBmaXJzdEFycmF5W2ldOwoJICAgIH0KCSAgICBTeXN0ZW0ub3V0LnByaW50bG4oIlxuUHJpbWVpcm8gQXJyYXk6Iik7CgkgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBmaXJzdEFycmF5Lmxlbmd0aDsgaSsrKSB7CgkgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoZmlyc3RBcnJheVtpXSArICI7ICIpOwoJICAgIH0KCSAgICBTeXN0ZW0ub3V0LnByaW50bG4oIlxuU2VndW5kbyBBcnJheToiKTsKCSAgICBmb3IgKGludCBpID0gMDsgaSA8IHNlY29uZEFycmF5Lmxlbmd0aDsgaSsrKSB7CgkgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoc2Vjb25kQXJyYXlbaV0gKyAiOyAiKTsKCSAgICB9CiAgICB9Cn0=