Программа:
Python:
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
arr2 = sorted(arr, reverse=True)
print(arr2)
Pascal:
var
arr: array[1..20] of integer = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
arr2: array[1..20] of integer;
begin
for var i := 1 to 20 do begin
arr2[i] := arr[abs(20 - i + 1)];
end;
writeln(arr2);
end.
Программа:
Python:
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
arr2 = sorted(arr, reverse=True)
print(arr2)
Pascal:
var
arr: array[1..20] of integer = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
arr2: array[1..20] of integer;
begin
for var i := 1 to 20 do begin
arr2[i] := arr[abs(20 - i + 1)];
end;
writeln(arr2);
end.